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

#define INF 999999999

int gcd(int x, int y) {
	if (x % y == 0)return y;
	else return gcd(y, x%y);
}

int lcm(int x, int y) {
	return x*y / gcd(x, y);
}

int main() {
	int a[30] = { 0 };
	a[0] = 1; a[1] = 2; a[2] = 4;
	for (int i = 3; i < 30; i++) {
		a[i] = a[i - 1] + a[i - 2] + a[i - 3];
	}
	while (1) {
		int n;
		cin >> n;
		if (n == 0)break;
		if (a[n-1] % 3650 == 0)cout << a[n-1] / 3650 << endl;
		else cout << a[n-1] / 3650 + 1 << endl;
	}
	return 0;
}
