#include <stdio.h>
#include <iostream>
#include <string>



int main(void){
	
	int *num,t=0,a[4];
	a[0] = 0, a[1] = 1;
	int ans;
	num = new int[1000];

	do{
		std::cin >> num[t];
		t++;
	} while (num[t - 1] != 0);

	t = 0;
	while (num[t] != 0){
		a[0] = 0; a[1] = 0, a[2] = 1;
		for (int i = 0; i < num[t]; i++){
			a[3] = a[2] + a[1]+a[0];
			a[0] = a[1];
			a[1] = a[2];
			a[2] = a[3];
		}
		std::cout << (int)a[3]/365/10+1<<std::endl;
		t++;
	}


	return 0;
}
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

int stair(int n){
	if(n==1)
		return 1;
	else if(n==2)
		return 2;
	else if(n==3)
		return 4;
	else 
		return stair(n-1)+stair(n-2)+stair(n-3);
}

int main(){
	int n;
	while(scanf("%d",&n) && n!=0){
		int year = stair(n)/3650;
		if(stair(n)%3650!=0)  year++;
		cout<<year<<endl;
	}

	return 0;
}