N = int(input()) S = 0 for n in range(1, int(N**0.5)+1): if N % n == 0: S += n if n * n != N: S += N // n print(S)