






'''simple docstring'''

from timeit import timeit







def 					lowercase__				(   __UpperCamelCase					)->				int:
      if number < 0:
            raise ValueError("""the value of input must not be negative"""					)
      UpperCamelCase       						=      0
      while number:
            number &= number - 1
            result += 1
      return result







def 					lowercase__				(   __UpperCamelCase					)->				int:
      if number < 0:
            raise ValueError("""the value of input must not be negative"""					)
      UpperCamelCase       						=      0
      while number:
            if number % 2 == 1:
                  result += 1
            number >>= 1
      return result







def 					lowercase__				(   )->				None:

      def do_benchmark(__UpperCamelCase					) -> None:
            UpperCamelCase       						=      """import __main__ as z"""
            print(F"Benchmark when {number = }:"					)
            print(F"{get_set_bits_count_using_modulo_operator(__UpperCamelCase					) = }"					)
            UpperCamelCase       						=      timeit("""z.get_set_bits_count_using_modulo_operator(25)"""	,		setup=__UpperCamelCase					)
            print(F"timeit() runs in {timing} seconds"					)
            print(F"{get_set_bits_count_using_brian_kernighans_algorithm(__UpperCamelCase					) = }"					)
            UpperCamelCase       						=      timeit(
                """z.get_set_bits_count_using_brian_kernighans_algorithm(25)"""	,		setup=__UpperCamelCase	,		)
            print(F"timeit() runs in {timing} seconds"					)

      for number in (25, 37, 58, 0):
            do_benchmark(__UpperCamelCase					)
            print()


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     benchmark()








'''simple docstring'''

from math import sqrt







def 					lowercase__				(   __UpperCamelCase					)->				int:
      UpperCamelCase       						=      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 = 10000					)->				int:
      UpperCamelCase       						=      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())))
