Is it possible to measure water flux across the membrane in GROMACS?

GROMACS version: 2018.4
GROMACS modification: No

I want to measure water flux across the membrane. This water flux is described here:
https://pubs.acs.org/doi/10.1021/acs.jpcb.6b01870
"Water flux across the membrane
Based on the number of water molecules that passed the bilayer the water flux F was
estimated as
F = (NV)/(AT)
N is the number of water molecules that passed the bilayer, V the volume of one water
molecule, A is the average membrane area, and T the analyzed simulation time (140 ns).
"

Do you know how can I do it in GROMACS? I think that I must probably write my own script for that. I think about something like that: checking is there any water in the hydrophobic part of my bilayer and if the water molecule will be on the other side of the bilayer I will count that molecule (so I analyzed where this molecule was before when it is in the hydrophobic part and when it was after). So I must probably check each frame and analyze the z-coordinates of my water molecules. If you have any advice I would be very happy. Thanks in advance.