Generate Histogram of HBonds

GROMACS version: 2022
GROMACS modification: No

Hi,

I need to generate a histogram with the number of water molecules making 1, 2, 3 or 4 hydrogen bonds with other water molecules. I thought about using gmx hbond for this, but as far as I know there is no flag to generate such histogram. Is there any way of doing it with gmx hbond or do I have to do it from scratch - write a program to calculate the distances and angles between hydrogen donors and acceptors and use it to determine the number of molecules making each number of bonds?

Thanks