#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>

struct Memo
{

	int count;
	bool flag;

	Memo()
	{

		count = 0;
		flag = false;

	}

};

using namespace std;

Memo memo[31][4];

int ProgressNumberOfYears(int step_num,int step_length)
{

	int kind_count = 0;

	if(memo[step_num][step_length].flag && step_length != 0) return memo[step_num][step_length].count;
	else if(step_num == 0) return 1;
	else if(step_num < 0) return 0;

	for(int i = 1; i < 4; ++i)	kind_count += ProgressNumberOfYears(step_num - i,i);

	Memo temp;

	temp.count = kind_count;
	temp.flag = true;

	memo[step_num][step_length] = temp;

	return kind_count;

}

int main()
{

	int step_num;

	while(cin >> step_num && step_num != 0) cout << ProgressNumberOfYears(step_num,0) / 10 / 365 + 1 << endl;

	return 0;

}