Count lines in a string.