i want to calculate how much amount of water had been used through water flow sensor
Well count the pulses coming from flow sensor.
Multiply it by factor given as in datasheet of flow sensor.
e.g if it is written that for every 10 pulses 1 liter of fluid has been passed.
So you have to divide the count value by 10 to get values in liter.