#include<iostream>
using namespace std;

class Answer
{
public:
	Answer(){day = 10; year = 365;}
	
	int N;	//??\???
	int day;
	int year;
	unsigned long long count(int cnt);	//??¨??¢?´¢(???)
	void set();	//??\???
	void OutPut();	//???????????????
	
	bool empty();	//???????????¶?????????
	bool ans();	//?§£???
};

unsigned long long Answer::count(int cnt)
{
	if( cnt < 0)
		return 0;
	
	else if(cnt == 0)
		return 1;
	
	return count(cnt - 1) + count(cnt - 2) + count(cnt - 3);
}

void Answer::OutPut()
{
	if( N == 0 )
		return;
	int ans_ = 1;	//??????????????´???
	ans_ += (count( N )) / (day * year);	//??\???
	
	cout << ans_ << endl;;
}

void Answer::set()
{
	cin >> N;
}

bool Answer::empty()
{
	if( N == 0 )return false;
	else return true;
}

bool Answer::ans()
{
	set();
	OutPut();
	return empty();
}

int main()
{
	Answer ans;

	while( ans.ans() );
	return 0;
}
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

const int MAX = 30;
int dp[MAX + 1];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	dp[0] = 1;
	for (int i = 0; i <= MAX - 1; i++) {
		for (int j = 1; j <= 3; j++) {
			if (i + j <= MAX)
				dp[i + j] += dp[i];
		}
	}

	int n;
	while (cin >> n , n) {
		cout << ((dp[n] + 9) / 10 + 364) / 365 << endl;
	}
}