#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int dp[41];


int main(){
    memset(dp,0,sizeof(dp));
    dp[0] = 1;
    for(int j=0;j<30;j++){
	for(int i=1;i<=3;i++){
	    dp[i+j] += dp[j];
	}
    }
    while(true){
	int n;
	cin >> n;
	if(n == 0) break;
	int fact = dp[n]/10 + ((dp[n]%365==0) ? 0 : 1) ;
	cout << fact/365 + ((fact%365==0) ? 0 : 1) << endl;
    }
    return 0;
}
#include<iostream>
using namespace std;

#define MEMO_MAX 100
typedef unsigned long long ULL;

bool Flag_memo_g = true;	//?????¢??????????????????

class Answer
{
public:
	Answer()
	{
		day = 10; year = 365;
		for(int i = 0; i < MEMO_MAX; i++)
		{
			memo[i] = 0;
			Flag_memo[i] = false;
		}
	}
	
	int N;	//??\???
	int day;
	int year;

	ULL memo[MEMO_MAX];
	bool Flag_memo[MEMO_MAX];
	
	ULL count(int cnt);	//??¨??¢?´¢(??±???)
	ULL count_memo(int cnt);	//??¨??¢?´¢(??±???)(?????¢???ver.)
	void set();	//??\???
	void OutPut();	//???????????????
	
	bool empty();	//???????????¶?????????
	bool ans();	//?§£???
};

ULL 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);
}


ULL Answer::count_memo(int cnt)
{
	if( cnt < 0 )return 0;
	else if( cnt == 0 )return 1;
	
	if( !(Flag_memo[cnt]) )
	{
		memo[cnt] = count_memo(cnt - 1) + count_memo(cnt - 2) + count_memo(cnt - 3);
		Flag_memo[cnt] = true;
	}
	
	return memo[cnt];
}

void Answer::OutPut()
{
	if( N == 0 )
		return;
	int ans_ = 1;	//??????????????´???
	if( Flag_memo_g )
		ans_ += count_memo( N ) / (day * year);
	
	else if( !Flag_memo_g )
		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;
}