#include <iostream>

using namespace std;

int A[40];

int main(void) {
	int n;
	while(cin >> n && n) {
		for (int i = 0; i <= n; i++) {
			if (i == 0) A[i] = 1;
			else if (i == 1) A[i] = 1;
			else if (i == 2) A[i] = 2;
			else A[i] = A[i-3] + A[i-2] + A[i-1];
		}
		int ans;
		if (A[n] % 3650 == 0) ans = A[n] / 3650;
		else ans = A[n] / 3650 + 1;
		cout << "\n" << ans;
	}

	return 0;
}

