#!/usr/bin/env python3 import math EPS = 0.0001 def divisors(n): ds = [] for i in range(1, math.floor(math.sqrt(n) + EPS) + 1): d, m = divmod(n, i) if m == 0: ds.append(i) if i != d: ds.append(d) ds.sort() return ds def sum_of_divisors(n): return sum(divisors(n)) def main(): n = int(input()) print(sum_of_divisors(n)) if __name__ == "__main__": main()