


'''simple docstring'''
from math import sqrt


def       _lowercase							(					UpperCamelCase__							:       int      ):
 __A	:		Any	  =      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       _lowercase							(					UpperCamelCase__							:       int = 10000      ):
 __A	:		Dict	  =      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())))










'''simple docstring'''
def       _lowercase							(					UpperCamelCase__							:       int,					UpperCamelCase__							:       int      ):
 return 1 if input_a == input_a else 0


def       _lowercase							(					):
 assert xnor_gate(0,					0      ) == 1
 assert xnor_gate(0,					1      ) == 0
 assert xnor_gate(1,					0      ) == 0
 assert xnor_gate(1,					1      ) == 1


if __name__ == "__main__":
 print(xnor_gate(0, 0))
 print(xnor_gate(0, 1))
 print(xnor_gate(1, 0))
 print(xnor_gate(1, 1))






