#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = (ll)1e9;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

int main()
{
	while (1)
	{
		int n;
		cin >> n;
		if (n == 0)
		{
			break;
		}

		vector<ll> dp(n + 1);
		dp.at(0) = 1;

		for (int i = 1; i <= n; i++)
		{
			for (int j = 1; j <= 3; j++)
			{
				if (i - j >= 0)
				{
					dp.at(i) = (dp.at(i) + dp.at(i - j));
				}
			}
		}

		cout << (dp.at(n) + 3650 + 1) / 3650 << endl;
	}

}
