



from math import sqrt






def      lowerCAmelCase__		(   lowerCamelCase_		:		Tuple):





				'''simple docstring'''

				lowerCAmelCase__					:    Union[str, Any]												=					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_		:		Any = 10000):





				'''simple docstring'''

				lowerCAmelCase__					:    Any												=					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())))






def      lowerCAmelCase__		(   lowerCamelCase_		:		str	,lowerCamelCase_		:		str):





				'''simple docstring'''

				lowerCAmelCase__					:    Optional[Any]												=					len(lowerCamelCase_)
				lowerCAmelCase__					:    str												=					len(lowerCamelCase_)
				lowerCAmelCase__					:    Union[str, Any]												=					[[False for _ in range(m + 1)] for _ in range(n + 1)]
				lowerCAmelCase__					:    List[Any]												=					True
				for i in range(lowerCamelCase_):
								for j in range(m + 1):
												if dp[i][j]:
																if j < m and a[i].upper() == b[j]:
																				lowerCAmelCase__					:    int												=					True
																if a[i].islower():
																				lowerCAmelCase__					:    int												=					True
				return dp[n][m]


if __name__ == "__main__":
							import doctest

							doctest.testmod()

