#include using namespace std; int main(){ unsigned long long n;cin>>n; unsigned long long ans = n; for(unsigned long long i = 2; 128 >= i; i++){ unsigned long long j = 1; unsigned long long t = 0; for(;n>j;j*=i)t++; ans = min(ans,i*t); } cout << ans << endl; }