#include<iostream>
#include <cstdio>
#include <cmath>
using namespace std;
const double PI =acos(-1.0);
const double e = 2.71828182;
int main()
{
double ans,res;
int n;
//斯特林定理求N!的位数
cin>>n;
ans = 1.0/2*log10(2*PI*n)+n*log10(n/e);;
cout<<(int)ans+1<<endl;
//log求N!的位数
res=1;
for(int i=1;i<=n;i++)
res += log10((double)i);
printf("%d
",(int)res);
return 0;
}