#include<iostream>

using namespace std;

long long
search(int n,int count){
	int i,j;
	if(n>2){
		count=search(n-3,count);
	}
	if(n>1){
		count=search(n-2,count);
	}
	if(n>0){
		count=search(n-1,count);
	}
	if(n==0)return count+1;
	//	return count;
}
int
main(){
	int d;
	while(true){
		cin>>d;
		if(!d)break;
		cout<<(search(d,0)/10)/365+1<<endl;;
	}
	return 0;
}