#include using namespace std; int main(){ int64_t A; cin >> A; int64_t ans = 1e18; auto enough = [](int64_t M, int N, int64_t A){ __int128_t P = 1; while(N--){ P *= M; if(P >= A) return true; } return false; }; for(int N=1; N<=60; N++){ int64_t ok = A, ng = 0; while(ok-ng>1){ int64_t mid = (ok+ng)/2; (enough(mid, N, A) ? ok : ng) = mid; } ans = min(ans, N*ok); } cout << ans << endl; return 0; }