
#include <algorithm>
#include <iostream>
using namespace std;

int  N, A[128];

int main() {
	A[0] = 1;
	for (int i = 1; i <= 32; ++i) {
		A[i] = A[i - 1];
		if (i >= 2)
			A[i] += A[i - 2];
		if (i >= 3)
			A[i] += A[i - 3];
	}
	while (cin >> N && N > 0 && N <= 30)
		cout << ((A[N]+9)/10 + 364) / 365 << endl;

	}