#include <bits/stdc++.h>

using namespace std;


int StepsData[31] = { 0,1,2,4 };



int main(void) {
	int n, years;

	for (int i = 4; i < 31; i++) {
		StepsData[i] = StepsData[i - 3] + StepsData[i - 2] + StepsData[i - 1];
	}

	while (cin >> n, n) {
		years = StepsData[n] / 3650;

		if (StepsData[n] % 3650 != 0) {
			years++;
		}
	
		cout << years << endl;		
	}

	return 0;
}
