import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) pf={} for i in range(2,int(n**0.5)+1): while n%i==0: pf[i]=pf.get(i,0)+1 n//=i if n>1: pf[n]=1 ans=1 for p in pf.keys(): k=pf[p] ans*=(p**(k+1)-1)//(p-1) print(ans)