calculate length of lines including backslashes correctly