from math import sqrt



def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: int			)							->      int:







  """simple docstring"""





  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 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: int = 1_00_00			)							->      int:







  """simple docstring"""





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

import pickle
import unittest

import torch

from accelerate import Accelerator
from accelerate.state import AcceleratorState
from accelerate.test_utils import require_cpu







@require_cpu
class __snake_case       (		unittest.TestCase	):




   def 			__a		(					self    :       Any   ):



     """simple docstring"""






     SCREAMING_SNAKE_CASE__    							=   torch.nn.Linear(10 ,			10   )
     SCREAMING_SNAKE_CASE__    							=   torch.optim.SGD(model.parameters() ,			0.1   )
     SCREAMING_SNAKE_CASE__    							=   Accelerator()
     SCREAMING_SNAKE_CASE__    							=   accelerator.prepare(_lowercase   )
     try:
       pickle.loads(pickle.dumps(_lowercase   )   )
     except Exception as e:
       self.fail(f"""Accelerated optimizer pickling failed with {e}"""   )
     AcceleratorState._reset_state()
