#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>

using namespace std;

const int INF = 1 << 29;
typedef pair<int, int> P;

int n;

int main(void)
{
	while(cin >> n && n)
	{
		int dp[33] = {0};
		dp[0] = dp[1] = dp[2] = 1;
		for (int d = 0; d < n; d++)
		{
			for (int i = 0; i < 3; i++)
			{
				dp[d + i + 1] += dp[d];
			}
		}
		cout << (dp[n - 1] - 1) / 10 / 365 + 1 << endl;
	}
	return 0;
}