def divisors(n): divs = [] for d in range(1, int(n**0.5) + 1): if n % d == 0: divs.append(d) q = n // d if q != d: divs.append(q) return divs print(sum(divisors(int(input()))))