def METHOD_NAME(number: int) -> int:
    """
    Sum of digits of a number until sum becomes single digit.
    Example:
        658 => 6 + 5 + 8 = 19 => 1 + 9 = 10 => 1
    """
    if number == 0:
        return 0
    if number % 9 == 0:
        return 9
    return number % 9