def get_line_number(from_index: int, in_string: str) -> int:
    """ Return the line number of which the character at an index in a string is located. """

    return in_string.count('\n', 0, from_index) + 1