取对数
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <cctype>
#include <algorithm>
#include <cmath>
#include <deque>
#include <map>
using namespace std;
///
#define INF 0xffffff7
#define MAXN 200
///
int year;
int main()
{ ///
int i, j;
int nums;
double mmax;
while (1)
{
cin >> year;
if (year == 0)
break;
nums = (year - 1960) / 10;
double mmax = pow(2, nums + 2) * log(2);
i = 2;
double val = log(i);
while (1)
{
if (val + log(i + 1) > mmax)
break;
val += log(i + 1);
i++;
}
cout << i << endl;
}
///
return 0;
}