#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	int tri[31];
	
	tri[0] = 1;
	tri[1] = 1;
	tri[2] = 2;
	
	while (cin >> n && n){
		
		for (int i = 3; i <= n; i++){
		    tri[i] = tri[i - 1] + tri[i - 2] + tri[i - 3];
		}
		
		cout << (tri[n] + 3649)/3650 << endl;
	}
	
	return 0;
}
