




from math import sqrt







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







def 			_a   (		SCREAMING_SNAKE_CASE_							:       int = 1_00_00  ):
					__lowerCAmelCase            = sum(
					    i
					    for i in range(1   ,   SCREAMING_SNAKE_CASE_  )
					    if sum_of_divisors(sum_of_divisors(SCREAMING_SNAKE_CASE_  )  ) == i and sum_of_divisors(SCREAMING_SNAKE_CASE_  ) != i  )
					return total


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










from math import ceil, sqrt







def 			_a   (		SCREAMING_SNAKE_CASE_							:       int = 1_00_00_00  ):
					__lowerCAmelCase            = 0

					for outer_width in range(3   ,   (limit // 4) + 2  ):
										if outer_width**2 > limit:
															__lowerCAmelCase            = max(ceil(sqrt(outer_width**2 - limit  )  )   ,   1  )
										else:
															__lowerCAmelCase            = 1
										if (outer_width - hole_width_lower_bound) % 2:
															hole_width_lower_bound += 1

										answer += (outer_width - hole_width_lower_bound - 2) // 2 + 1

					return answer


if __name__ == "__main__":
					print(f'''{solution() = }''')




