
'''simple docstring'''



from collections.abc import Generator




def 				_lowerCAmelCase  (			):
			__lowercase  ,						__lowercase			  =							0, 1
			while True:
						__lowercase  ,						__lowercase			  =							b, a + b
						yield b




def 				_lowerCAmelCase  (			lowerCamelCase_     :					int = 1_0_0_0			):
			__lowercase			  =							1
			__lowercase			  =							fibonacci_generator()
			while len(str(next(_a			)			)			) < n:
						answer += 1
			return answer + 1


if __name__ == "__main__":
	print(solution(int(str(input()).strip())))












'''simple docstring'''



from math import sqrt




def 				_lowerCAmelCase  (			lowerCamelCase_     :					int			):
			__lowercase			  =							0
			for i in range(1						,    int(sqrt(lowerCamelCase_			) + 1			)			):
						if n % i == 0 and i != sqrt(lowerCamelCase_			):
									total += i + n // i
						elif i == sqrt(lowerCamelCase_			):
									total += i
			return total - n




def 				_lowerCAmelCase  (			lowerCamelCase_     :					int = 1_0_0_0_0			):
			__lowercase			  =							sum(
			    i
			    for i in range(1						,    lowerCamelCase_			)
			    if sum_of_divisors(sum_of_divisors(lowerCamelCase_			)			) == i and sum_of_divisors(lowerCamelCase_			) != i			)
			return total


if __name__ == "__main__":
	print(solution(int(str(input()).strip())))





