n = int(input()) f = 1 ans = 0 while f * f <= n: if n % f == 0: if f * f == n: ans += f else: ans += f ans += n // f f += 1 print(ans)