Flow Sensor: How to get quantity rather than rate

I should have been more specific. I don't need to know anything about the RATE. All I need to do is know how much water flows (how many pulses) If it's just a few lines, would someone be able to show me a simple counter sketch that would count the number of pulses? I was hoping it'd be just a few simple lines to count the pulses until I get to a specificied pulse count. I'm new at this.