N = int(input()) L = [] for n in range(1, int(N**0.5)+1): if N % n == 0: L += [n] if not (N // n) in L: L += [N // n] print(sum(L))