#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } constexpr long long INF = 1LL << 60; constexpr int inf = 1000000007; constexpr long long mod = 1000000007LL; //constexpr long long mod = 998244353LL; using namespace std; typedef long long ll; ll power(ll x, ll n) { if (n == 0) { return 1; } if (n % 2 == 0) { return power(x * x, n / 2); } else { return x * power(x, n - 1); } } ll f(ll X, ll c) { ll t = pow(X, 1.0 / (double)c); ll res = INF; for (ll i = max(0LL, t - 2); i <= t + 2; i++) { if (power(i, c) >= X) { chmin(res, i); } } return res; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll a; cin >> a; ll res = INF; for (ll i = 1; i <= 60; i++) { chmin(res, i * f(a, i)); } cout << res << endl; }