#include #include #include #include #include #include #include #include #include #include #include //#include using namespace std; typedef long long ll; const int maxn = 3e5 + 10; const ll INF = 3e16 + 10; string int_to_string(int x) { string res = ""; while(x) { res += (x % 10) + '0'; x /= 10; } reverse(res.begin(), res.end()); return res; } int main() { ios_base::sync_with_stdio(false); string s; cin >> s; int fact = 1; map mapa; for(int i = 1; i <= 10; i++) { fact *= i; mapa[int_to_string(fact)] = i; } if(mapa.count(s)) { cout << mapa[s] << endl; return 0; } double sum = 0; double sz = s.size(); for(double i = 1; i <= 1000000; i += 1.0) { sum += log10(i); if(fabs(sz - sum) < 1.0) { cout << i << endl; return 0; } } return 0; }