N=int(input()) ANS=0 for i in range(2,N+1): while N%i==0: N//=i ANS+=i print(ANS)