#include <iostream>

int ways(int n)
{
	if (n==1) return 1;
	else if (n==2) return 2;
	else {
		int* DP = new int[n+1];
		DP[0] = 1; DP[1] = 1; DP[2] = 2;
		for (int i=3; i<=n; i++) {
			DP[i] = DP[i-1] + DP[i-2] + DP[i-3];
		}
		int res = DP[n];
		delete[] DP;
		return res;
	}
}

int main()
{
	int n;
	while (true) {
		std::cin >> n;
		if (n==0) break;
		int w = ways(n);
		int d = w / 10;
		if (w%10>0) d++;
		int y = d / 365;
		if (d%365>0) y++;
		std::cout << y << std::endl;
	}
	return 0;
}

