from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
					import accelerate





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							if not is_accelerate_available():
														return method
							snake_case_          =   version.parse(accelerate.__version__				).base_version
							if version.parse(UpperCamelCase__				) < version.parse('0.17.0'				):
														return method

							def wrapper(self       ,							*UpperCamelCase__       ,							**UpperCamelCase__				):
														if hasattr(self       ,							'_hf_hook'				) and hasattr(self._hf_hook       ,							'pre_forward'				):
																					self._hf_hook.pre_forward(self				)
														return method(self       ,							*UpperCamelCase__       ,							**UpperCamelCase__				)

							return wrapper







from math import sqrt





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






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





def  __lowerCamelCase     (			UpperCamelCase__ = 10000				):







							'''simple docstring'''






							snake_case_          =   sum(
							    i
							    for i in range(1       ,							UpperCamelCase__				)
							    if sum_of_divisors(sum_of_divisors(UpperCamelCase__				)				) == i and sum_of_divisors(UpperCamelCase__				) != i				)
							return total


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




