



_lowercase    	=		range(2, 20 + 1)
_lowercase    	=		[10**k for k in range(ks[-1] + 1)]
_lowercase    	=		{}



def 		lowerCAmelCase__     (       UpperCamelCase_					:							int			,							UpperCamelCase_					:							str			,							UpperCamelCase_					:							List[Any]			,							UpperCamelCase_					:							str						)->	List[Any]:
    A__					=       sum(a_i[j] for j in range(UpperCamelCase_			,							len(UpperCamelCase_						)						)						)
    A__					=       sum(a_i[j] * base[j] for j in range(min(len(UpperCamelCase_						)			,							UpperCamelCase_						)						)						)

    A__			,						A__					=       0, 0
    A__					=       n - i

    A__					=       memo.get(UpperCamelCase_						)

    if sub_memo is not None:
        A__					=       sub_memo.get(UpperCamelCase_						)

        if jumps is not None and len(UpperCamelCase_						) > 0:
            # find and make the largest jump without going over
            A__					=       -1
            for _k in range(len(UpperCamelCase_						) - 1			,							-1			,							-1						):
                if jumps[_k][2] <= k and jumps[_k][1] <= max_dn:
                    A__					=       _k
                    break

            if max_jump >= 0:
                A__			,						A__			,						A__					=       jumps[max_jump]
                # since the difference between jumps is cached, add c
                A__					=       diff + c
                for j in range(min(UpperCamelCase_			,							len(UpperCamelCase_						)						)						):
                    A__			,						A__					=       divmod(UpperCamelCase_			,							1_0						)
                if new_c > 0:
                    add(UpperCamelCase_			,							UpperCamelCase_			,							UpperCamelCase_						)

        else:
            A__					=       []
    else:
        A__					=       {c: []}
        A__					=       sub_memo

    if dn >= max_dn or c + diff >= base[k]:
        return diff, dn

    if k > ks[0]:
        while True:
            # keep doing smaller jumps
            A__			,						A__					=       next_term(UpperCamelCase_			,							k - 1			,							i + dn			,							UpperCamelCase_						)
            diff += _diff
            dn += terms_jumped

            if dn >= max_dn or c + diff >= base[k]:
                break
    else:
        # would be too small a jump, just compute sequential terms instead
        A__			,						A__					=       compute(UpperCamelCase_			,							UpperCamelCase_			,							i + dn			,							UpperCamelCase_						)
        diff += _diff
        dn += terms_jumped

    A__					=       sub_memo[c]

    # keep jumps sorted by # of terms skipped
    A__					=       0
    while j < len(UpperCamelCase_						):
        if jumps[j][1] > dn:
            break
        j += 1

    # cache the jump for this value digitsum(b) and c
    sub_memo[c].insert(UpperCamelCase_			,							(diff, dn, k)						)
    return (diff, dn)



def 		lowerCAmelCase__     (       UpperCamelCase_					:							int			,							UpperCamelCase_					:							Optional[Any]			,							UpperCamelCase_					:							List[str]			,							UpperCamelCase_					:							Tuple						)->	Optional[int]:
    if i >= n:
        return 0, i
    if k > len(UpperCamelCase_						):
        a_i.extend([0 for _ in range(k - len(UpperCamelCase_						)						)]						)

    # note: a_i -> b * 10^k + c
    # ds_b -> digitsum(b)
    # ds_c -> digitsum(c)
    A__					=       i
    A__			,						A__			,						A__					=       0, 0, 0
    for j in range(len(UpperCamelCase_						)						):
        if j >= k:
            ds_b += a_i[j]
        else:
            ds_c += a_i[j]

    while i < n:
        i += 1
        A__					=       ds_c + ds_b
        diff += addend
        A__					=       0
        for j in range(UpperCamelCase_						):
            A__					=       a_i[j] + addend
            A__			,						A__					=       divmod(UpperCamelCase_			,							1_0						)

            ds_c += a_i[j]

        if addend > 0:
            break

    if addend > 0:
        add(UpperCamelCase_			,							UpperCamelCase_			,							UpperCamelCase_						)
    return diff, i - start_i



def 		lowerCAmelCase__     (       UpperCamelCase_					:							Tuple			,							UpperCamelCase_					:							List[Any]			,							UpperCamelCase_					:							Optional[Any]						)->	int:
    for j in range(UpperCamelCase_			,							len(UpperCamelCase_						)						):
        A__					=       digits[j] + addend
        if s >= 1_0:
            A__			,						A__					=       divmod(UpperCamelCase_			,							1_0						)
            A__					=       addend // 1_0 + quotient
        else:
            A__					=       s
            A__					=       addend // 1_0

        if addend == 0:
            break

    while addend > 0:
        A__			,						A__					=       divmod(UpperCamelCase_			,							1_0						)
        digits.append(UpperCamelCase_						)



def 		lowerCAmelCase__     (       UpperCamelCase_					:							int = 1_0**1_5						)->	int:
    A__					=       [1]
    A__					=       1
    A__					=       0
    while True:
        A__			,						A__					=       next_term(UpperCamelCase_			,							2_0			,							i + dn			,							UpperCamelCase_						)
        dn += terms_jumped
        if dn == n - i:
            break

    A__					=       0
    for j in range(len(UpperCamelCase_						)						):
        a_n += digits[j] * 1_0**j
    return a_n


if __name__ == "__main__":
   print(F"{solution() = }")





def 		lowerCAmelCase__     (       UpperCamelCase_					:							int						)->	int:
    A__					=       1
    for i in range(1			,							num + 1						):
        fact *= i
    return fact



def 		lowerCAmelCase__     (       UpperCamelCase_					:							int						)->	int:
    A__					=       0
    while number > 0:
        A__					=       number % 1_0
        sum_of_digits += last_digit
        A__					=       number // 1_0  # Removing the last_digit from the given number
    return sum_of_digits



def 		lowerCAmelCase__     (       UpperCamelCase_					:							int = 1_0_0						)->	int:
    A__					=       factorial(UpperCamelCase_						)
    A__					=       split_and_add(UpperCamelCase_						)
    return result


if __name__ == "__main__":
   print(solution(int(input("Enter the Number: ").strip())))
