#include <iostream>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <sstream>
using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long

int n;

int a[30];

int main()
{
	a[0] = 1;
	a[1] = 1;
	a[2] = 2;
	FOR(i,3, 31)
	{
		a[i] = a[i - 3] + a[i - 2] + a[i - 1];
	}
	while (1)
	{
		cin >> n; if (!n) return 0;
		if (a[n] % 3650 == 0) cout << a[n] / 3650 << endl;
		else cout << (a[n] /3650) + 1 << endl;
	}
}