#include<bits/stdc++.h>
using namespace std;
const double PI=3.1415926;
typedef long long LL;
int main(){
LL x;
scanf("%lld",&x);
LL l=10,r=1LL<<40,node;
double key=log(x)*x;
while(l<=r){
LL mid=(l+r)>>1;
if(log(sqrt(2*PI*mid))+mid*(log(mid)-1)>key) node=mid,r=mid-1;
else l=mid+1;
}
printf("%lld\n",node);
}