#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PI 3.1415926
#define E 2.718281828459
int main()
{
ll n;
cin >> n;
ll res = 0.5 * log10(2.0 * PI * n) + n * log10(n * 1.0 / E) + 1;
cout << res << endl;
return 0;
}
推导过程就不写了,网上到处都是,写一下模板就行