# No.888 約数の総和 n = int(input()) divisors = [] if n == 1: divisors = [1] elif n < 4: divisors = [1, n] else: divisors = [1, n] for i in range(2, int(n ** 0.5) + 2): if n % i == 0: divisors.append(i) divisors.append(n // i) print(sum(divisors))