def make_divisors(N):#約数列挙O(√N) lower_divisors , upper_divisors = [], [] i = 1 while i*i <= N: if N % i == 0: lower_divisors.append(i) if i != N // i: upper_divisors.append(N//i) i += 1 return lower_divisors + upper_divisors[::-1] N = int(input()) print(sum(make_divisors(N)))