N = int(input()) ans = 0 for x in range(1, N // 2): if N % x == 0: if N // x == x: ans += x else: ans += x + N // x print(ans)