#define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include using namespace std; ll a; double f(double x) { return x*log(a)/log(x); } int main() { cin >> a; double low = 0; double high = 1e18+7; int cnt = 500; while (cnt--) { double c1 = (low * 2 + high) / 3; double c2 = (low + high * 2) / 3; if (f(c1) > f(c2)) low = c1; else high = c2; } int l=low; ll b=a,c=a; int cnt1=0,cnt2=0; while(b>0){ b/=l; cnt1++; } while(c>0){ c/=(l+1); cnt2++; } if(a<6) cout<