
'''simple docstring'''



import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Union






@dataclass
class 							__lowercase    :







	'''simple docstring'''

	a      :			Optional[Union[str, Path]]     =    None
	a      :			bool     =    False
	a      :			bool     =    False
	a      :			bool     =    False
	a      :			Optional[Dict]     =    None
	a      :			Optional[str]     =    None
	a      :			bool     =    False
	a      :			bool     =    False
	a      :			bool     =    False
	a      :			bool     =    True
	a      :			Optional[int]     =    None
	a      :			int     =    1
	a      :			Optional[Union[str, bool]]     =    None
	a      :			bool     =    False
	a      :			Optional[Dict]     =    None
	a      :			Optional[str]     =    None


	def   _UpperCAmelCase       (self	)							->							"DownloadConfig":







				'''simple docstring'''





				return self.__class__(**{k: copy.deepcopy(_lowerCamelCase	) for k, v in self.__dict__.items()}	)












'''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())))





