import numpy as np n = int(input()) U = (10**12) ** 0.5 + 1 x = np.arange(1, U, dtype=np.int64) div = x[n%x==0] print(sum(div))