N=int(input()) m=0 for i in range(1,int(N**0.5)+1): if N%i==0: m+=i+N//i print([m,m-i][i*i==N])