total-lines-mode provides a variable, `total-lines' which holds the total number of lines in the current buffer at any given time. You could display it in your modeline, for instance.