#include<iostream>
using namespace std;

int dp[31];

int main()
{
	while (true)
	{
		for(int i = 0; i < 31; i++)
			dp[i] = 0;

		int n;
		cin >> n;
		if(n == 0)break;

		dp[1] = 1;
		dp[2] = 2;
		dp[3] = 4;

		for(int i = 4; i <= n; i++)
			dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3];

		int ans = 0;
		if(dp[n] / 3650 == 0)ans = 1;
		else
			ans = (dp[n] / 3650) ? dp[n] / 3650 + 1 : dp[n] / 3650;

		cout << ans << endl;
	}

	return 0;
}