import math N=int(input()) p=int(math.sqrt(N)+1-10**(-7)) ans=p while N//p!=N//(p+1): p+=1 ans+=N//p-1 print(ans)