def count_lines(text, width):
    """Return a fractional line count (filled lines plus fraction of last line)"""
    lines = text.splitlines()
    count = len(lines[:-1]) + len(lines[-1]) / width
    return count
