#include<iostream>
using namespace std;

int main(){
	int n=1;
	double ans =0;
	int checkc = 0;
	int i = 4;
	double check[3] = { 1, 2, 4 };
	
	while (n != 0){
		cin >> n;

		switch (n){
		case 1:
			ans = 1;
			break;
		case 2:
			ans = 2;
			break;
		case 3:
			ans = 4;
			break;
		default:
			while (n >= i){
				ans = check[0] + check[1] + check[2];
				i++;
				check[0] = check[1];
				check[1] = check[2];
				check[2] = ans;
			}
		}

		ans = ans / 3650;
		checkc = (int)(ans);

		if (ans > (double)(checkc)){
			checkc++;
		}
		if (ans != 0){
			cout << checkc << endl;
		}
		else{
			cout << endl;
		}
	}
	return 0;
}