import math n = int(input()) divisor = [] for i in range(1, int(math.sqrt(n))+1): if (n % i == 0): divisor.append(i) if (not int(n / i) == i): divisor.append(int(n / i)) print(sum(divisor))