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

int factorialDigit1( int n ) {
    long long fact = 1;
    for ( int i = 2; i <= n; i++ ) {
        fact *= i;
    }

    int res = 0;
    while ( fact ) {
        res++;
        fact /= 10;
    }
    return res;
}

int factorialDigit2( int n ) {
    double x = 0;
    for ( int i = 1; i <= n; i++ ) {
        x += log10 ( i );
    }
    int res = ( (int) x ) + 1;
    return res;
}

char buf[256];
FILE* in, *out;
int main()
{

    for (int i = 1; i <=100; i++) {
        sprintf(buf, "%d.in", i);
        in = fopen(buf, "w");
        fprintf(in, "%d\n", i);

        sprintf(buf, "%d.out", i);
        out = fopen(buf, "w");
        fprintf(out, "%d\n", factorialDigit2(i));

        fclose(in);
        fclose(out);
    }
    return 0;
