N=int(input()) sum=0 for i in range(1,10**12+1): if N % i == 0: sum+=i print(sum)