n = int(input()) i = 1 s = 0 while(i * i <= n): if n % i == 0: s += i if i * i != n: s += n // i i += 1 print(s)