#include <iostream>
#include <cmath>
using namespace std;

unsigned long long stirlingLn(double x) {
  return floor(log10(sqrt(2*acos(-1.0)*x))+x*log10(x/exp(1)))+1;
}

int main() {
	cout << stirlingLn(1e9);
}