#include <iostream>
using namespace std;
int n , now = 0;
int saiki(int now){
	if( now == n )
		return 1;
	if( now > n )
		return 0;
	int res = 0;
	res += saiki(now+1)+saiki(now+2)+saiki(now+3);
	return res;
}
int main(){
	while(1){
		cin >> n;
		if( n==1 ){
			cout << 1 << endl;
			continue;
		}
		if( n==0 ) break;
		int count = saiki(0);
		count = count / 10;
		int x = count / 365 ;
		if(count%365>0)
			x ++;
		cout << x << endl;
}
}