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