#include <iostream>
using namespace std;

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