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