count number of lines input by user