



'''simple docstring'''





from math import sqrt





def 						__snake_case(				_lowerCAmelCase		)		-> int:
      snake_case__  :    Optional[Any]    						=      0
      for i in range(1     ,   int(sqrt(_lowerCAmelCase		) + 1		)		):
            if n % i == 0 and i != sqrt(_lowerCAmelCase		):
                  total += i + n // i
            elif i == sqrt(_lowerCAmelCase		):
                  total += i
      return total - n





def 						__snake_case(				_lowerCAmelCase = 10_000		)		-> int:
      snake_case__  :    Optional[Any]    						=      sum(
          i
          for i in range(1     ,   _lowerCAmelCase		)
          if sum_of_divisors(sum_of_divisors(_lowerCAmelCase		)		) == i and sum_of_divisors(_lowerCAmelCase		) != i		)
      return total


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





'''simple docstring'''





import string
from math import logaa





def 						__snake_case(				_lowerCAmelCase     ,   _lowerCAmelCase		)		-> int:
      snake_case__  :    List[str]    						=      document.translate(
          str.maketrans(""""""     ,   """"""     ,   string.punctuation		)		).replace("""\n"""     ,   """"""		)
      snake_case__  :    List[str]    						=      document_without_punctuation.split(""" """		)  # word tokenization
      return len([word for word in tokenize_document if word.lower() == term.lower()]		)





def 						__snake_case(				_lowerCAmelCase     ,   _lowerCAmelCase		)		-> tuple[int, int]:
      snake_case__  :    Dict    						=      corpus.lower().translate(
          str.maketrans(""""""     ,   """"""     ,   string.punctuation		)		)  # strip all punctuation and replace it with ''
      snake_case__  :    Any    						=      corpus_without_punctuation.split("""\n"""		)
      snake_case__  :    int    						=      term.lower()
      return (len([doc for doc in docs if term in doc]		), len(_lowerCAmelCase		))





def 						__snake_case(				_lowerCAmelCase     ,   _lowerCAmelCase     ,   _lowerCAmelCase=False		)		-> float:
      if smoothing:
            if n == 0:
                  raise ValueError("""log10(0) is undefined."""		)
            return round(1 + logaa(n / (1 + df)		)     ,   3		)

      if df == 0:
            raise ZeroDivisionError("""df must be > 0"""		)
      elif n == 0:
            raise ValueError("""log10(0) is undefined."""		)
      return round(logaa(n / df		)     ,   3		)





def 						__snake_case(				_lowerCAmelCase     ,   _lowerCAmelCase		)		-> float:
      return round(tf * idf     ,   3		)
