#include<iostream>
using namespace std;

int main(void){

	int stairs[32],years[32];

	stairs[0]=1;
	stairs[1]=1;
	stairs[2]=stairs[0]+stairs[1];
	years[0]=1;
	years[1]=1;
	years[2]=1;

	int maxi=2;

	int input;
	cin >> input;

	while(input){
		if(input>maxi){
			while(maxi<input){
				maxi++;
				stairs[maxi]=stairs[maxi-1]+stairs[maxi-2]+stairs[maxi-3];
				years[maxi]=stairs[maxi]/3650;
				if(stairs[maxi]%3650)
					years[maxi]++;
			}
			cout << years[input] << endl;
		}else{
			cout << years[input] <<endl;
		}
		cin >> input;
	}

	return 0;

}

