N = input() if N % 2 == 0: print(1) quit() ans = 0 i = 1 while N >= i * i: if N == i * i: ans += i i += 1 break elif N % i == 0: ans += (N / i) + i i += 1 else: i += 1 print(ans)