http://acm.hust.edu.cn/vjudge/contest/view.action?cid=29592#problem/O
// File Name: bo_jwolf15.cpp
// Author: rudolf
// Created Time: 2013年08月20日 星期二 09:37:05
#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<ctime>
using namespace std;
#define eps 1e-10
int main()
{
int n , i ;
while( cin >> n && n )
{
double temp = pow( (double )2 , ( n - 1960 ) / 10 + 2 ) * log( (double) 2 );
double sum = 0 ;
for( i =1; ; ++i )
{
sum += log((double) i ) ;
if( sum - temp >= eps )
break ;
}
cout << i - 1 << endl ;
}
return 0;
}
// File Name: bo_jwolf15_string.cpp
// Author: rudolf
// Created Time: 2013年08月20日 星期二 10:17:08
#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<ctime>
using namespace std;
#define PI 3.141592654
#define E 2.71828182846
int main()
{
int n , i;
while( cin >> n && n )
{
double temp1 = pow( ( double )2 ,( n - 1960 )/10 + 2) ;
for( i = 4 ; ; ++i )
{
double temp2 = 0.5 * log( 2 * PI * i ) + i * log( i / E ) ;
if( temp2 / log( (double ) 2 ) > temp1 )
break ;
}
cout << i - 1 << endl ;
}
return 0;
}