N = int(input()) k = 1 res = 0 while k**2 <= N: if k**2 == N: res += k elif N % k == 0: res += k + N // k k += 1 print(res)