

def 			lowerCamelCase__			(       _a				,      _a = False):

	if not isinstance(_a				,      _a):
		SCREAMING_SNAKE_CASE :   List[Any]					  =							f"Expected string as input, found {type(_a)}"
		raise ValueError(_a)
	if not isinstance(_a				,      _a):
		SCREAMING_SNAKE_CASE :   List[Any]					  =							f"Expected boolean as use_pascal parameter, found {type(_a)}"
		raise ValueError(_a)

	SCREAMING_SNAKE_CASE :   Dict					  =							input_str.split("_")

	SCREAMING_SNAKE_CASE :   List[str]					  =							0 if use_pascal else 1

	SCREAMING_SNAKE_CASE :   Dict					  =							words[start_index:]

	SCREAMING_SNAKE_CASE :   str					  =							[word[0].upper() + word[1:] for word in words_to_capitalize]

	SCREAMING_SNAKE_CASE :   Optional[Any]					  =							"" if use_pascal else words[0]

	return "".join([initial_word, *capitalized_words])


if __name__ == "__main__":
			from doctest import testmod

			testmod()

from math import sqrt






def   lowerCamelCase__							(							__lowerCAmelCase    :    int							):




			"""simple docstring"""


			lowerCAmelCase_         =      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 = 10000							):




			"""simple docstring"""


			lowerCAmelCase_         =      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())))



