





from ..utils import DummyObject, requires_backends

class       __A     (						metaclass=a    ):
				__A      =				["""onnx"""]


				def __init__(		self   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(self   , ["""onnx"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""onnx"""]							)


				@classmethod
				def _snake_case       (		cls   , *UpperCAmelCase_   , **UpperCAmelCase_							):
								requires_backends(cls   , ["""onnx"""]							)












from math import sqrt





def      _lowercase					(						_UpperCAmelCase				)						->  int:
				lowerCamelCase	 =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      _lowercase					(						_UpperCAmelCase = 1_00_00				)						->  int:
				lowerCamelCase	 =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())))





