N=int(input()) ans=[N//i+i for i in range(1,int(N**0.5)+1) if N%i==0] print(sum(ans) if int(N**0.5)!=N**0.5 else int(sum(ans)-N**0.5))