N=int(input()) ans=int(1e100) for i in range(100): x=pow(N,-1-i) if(x**(i+1)>N): ans=min(ans,x*(i+1)) x+=1 if(x**(i+1)>N): ans=min(ans,x*(i+1)) print(ans)