count-lines

count-lines is a compiled Lisp function in `simple.el'.

(count-lines START END)

Return number of lines between START and END.
This is usually the number of newlines between them,
but can be one more if START is not equal to END
and the greater of them is not at the start of a line.