#include<iostream>
using namespace std;



int main(void)
{

	//入力変数
	int n = 0;

	//DP変数
	long long int h_dp[31] = {0};

	h_dp[0] = 1;
	h_dp[1] = 1;
	h_dp[2] = 2;

	//DPを列挙
	for (int i = 3; i <= 30; i++)
	{
		h_dp[i] = h_dp[i - 1] + h_dp[i - 2] + h_dp[i - 3];
	}

	while (true)
	{
		cin >> n;
		if (n == 0)	{	return 0;	}

		//年数出力
		long long int year = 0;

		if (n <= 10)
		{
			year = 1;
		}
		else
		{
			//求めたDPを利用
			year = h_dp[n] / 3650;
			if (h_dp[n] % 3650 != 0)
			{
				year++;
			}
		}

		cout << year << endl;
	}

	return 0;
}