Count lines method