Count the no of lines between two words

Please help in the following problem:
Input is:
Pritam
123
456
Patil
myname
youname
Pritam
myproject
thisproject
iclic
Patil
remaining text
some more text

I need the command which will display the no of lines between two words in the whole file.
e.g. Display all the no of lines between 'Pritam' and 'Patil'.

so out put should be 2, 3. (there r 2 lines between two words, subsequently there r 3 lines)

Thanks for any help in advance.

 
awk '/Pritam/,/Patil/{c++;next}{if(c!=0) print c-2;c=0}' infile

Can be done following way...

awk '/Pritam/,/Patil/{n++}; END {print n-2}' filename

I tried your code and it gave me 7.
But the OP is expecting output 2 and 3.

Try this

awk '/Pritam/,/Patil/ {c++;} /Patil/ {print c-2;c=0}' file

Regards,

Ranjith

something like this :

awk '/Pritam/ {c++;next} /Patil/ {print a[c];next} {a[c]++} ' input_file.txt