#include<iostream>
using namespace std;
int main(){
	int a[32], b[32],c;
	int d = 0;
	a[0] = 1; a[1] = 1; a[2] = 2;
	b[0] = 1; b[1] = 1; b[2] = 1;
	for (int x = 3; x <= 30; x++){
		a[x] = a[x - 1] + a[x - 2] + a[x - 3];
		if (a[x] % 3650 == 0)b[x]=a[x]/3650;
		else b[x]=a[x]/3650+1;
	}
	while (1){
		cin >> d;
		if (d == 0)break;
		cout << b[d]<<endl;

	}
	return 0;
}
