




from math import sqrt

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int							) ->			int:
      SCREAMING_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  UpperCAmelCase_							(				__UpperCAmelCase						:     int = 1_00_00							) ->			int:
      SCREAMING_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())))





from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
   import accelerate

def  UpperCAmelCase_							(				__UpperCAmelCase						:     Optional[int]							) ->			int:
      if not is_accelerate_available():
            return method
      SCREAMING_SNAKE_CASE_     						=      version.parse(accelerate.__version__							).base_version
      if version.parse(__UpperCAmelCase							) < version.parse('0.17.0'							):
            return method

      def wrapper(self						:     Optional[int]      ,      *__UpperCAmelCase						:     Optional[Any]      ,      **__UpperCAmelCase						:     Optional[Any]							):
            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