Medium allows you to access X-1 additional cards if it has X counters. So you can access up to 1 + X-1 = X cards total (you have to choose the exact number before accessing any cards), including the one you normally access. 2 copies of Medium with X counters each allow you to access a total of 1 + X-1 + X-1 = 2X-1 cards.
While the above comment is 100% correct, it kind if made my brain bleed a little, so I thought I would try to simplify this a bit for anyone having trouble with medium.
First, like everyone above already said, according to the timing chart, the run is considered successful before you access cards, so you add a virus counter to medium before accessing cards.
If you have one medium in play, the math is real simple. If you have 4 virus counters on medium when you access cards, you can access up to 4 cards. One is mandatory, the other three are optional. That's it. No crazy math required. 4 counters means 4 cards. Just remember that 1 card is mandatory.
Now if you have two mediums in play, the math gets a little more complicated. Now you have to subtract 1. Add up the counters on the two mediums and subtract one. That's how many cards you can access. Like before, 1 card is mandatory and the rest are optional.
With three mediums, you just subtract 2.
Final rule, also as mentioned above, you have to declare how many optional cards you will access before you access them. No hitting a Snare and then deciding enough is enough. If you decide to access 5 optional cards (after you one mandatory card of course), you are committed until the end.
I hope this helps.