countlines function

Count the number of lines in a file