def count_lines(line, wanted_length=77):
    """Return an approximate line count given a string"""
    lines = line.split("\n")
    count = len(lines) - 1
    for row in lines:
        length = len(row)/wanted_length
        if length < 1.0:
            continue
        count += int(length)
    return count