N=int(input()) ans=int(1e100) for i in range(100): if i==0: continue x=pow(N,1/i) x=int(x) #print(x**i) if(x**i>N): ans=min(ans,x*i) for j in range(10000): x+=1 if(x**i>N): ans=min(ans,x*i) print(ans)