





'''simple docstring'''







from math import sqrt

def    __UpperCamelCase	(	a    : int     ) ->int:
 snake_case				=			0
 for i in range(1					,   int(sqrt(a     ) + 1     )     ):
  if n % i == 0 and i != sqrt(a     ):
   total += i + n // i
  elif i == sqrt(a     ):
   total += i
 return total - n

def    __UpperCamelCase	(	a    : int = 1_0000     ) ->int:
 snake_case				=			sum(
     i
     for i in range(1					,   a     )
     if sum_of_divisors(sum_of_divisors(a     )     ) == i and sum_of_divisors(a     ) != i     )
 return total


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








'''simple docstring'''







from ..utils import DummyObject, requires_backends
class 			_lowercase						(       metaclass=__a					):
     _UpperCAmelCase										=					['''transformers''', '''torch''', '''note_seq''']







     def __init__( self    ,   *A__    ,   **A__    ) ->	Union[str, Any]:
      requires_backends(self    ,   ['''transformers''', '''torch''', '''note_seq''']    )







     @classmethod
     def     UpperCamelCase			( cls    ,   *A__    ,   **A__    ) ->	Optional[Any]:
      requires_backends(cls    ,   ['''transformers''', '''torch''', '''note_seq''']    )







     @classmethod
     def     UpperCamelCase			( cls    ,   *A__    ,   **A__    ) ->	Any:
      requires_backends(cls    ,   ['''transformers''', '''torch''', '''note_seq''']    )

