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