#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
	int kaidan[40];
	kaidan[1] = 1;
	kaidan[2] = 2;
	kaidan[3] = 4;
	for(int i = 4; i <= 30; i++){
        kaidan[i] = kaidan[i-1] + kaidan[i-2] + kaidan[i-3];
	}
    while(1){
        int n;
        cin >> n;
        if(n == 0) break;
        cout << kaidan[n] / 3650 + 1 << endl;
    }

	return 0;
}