You might want to estimate what you'll need for the entire visit and buy a farecard accordingly. Prices are posted on the machines for individual trips at peak and off-peak times.
If you come up a little short you can always add enough to a card to get out of the station.