#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(void){
	const int ofDay = 10;
	const int MAXN = 30;
	const int TOBIN = 3;
	const int YEAR = 365;
	int dp[MAXN+1];
	int tobi[TOBIN] = {1,2,3};
	
	// init
	for(int i=0; i<=MAXN; i++)
		dp[i] = 0;
	dp[1] = 1;
	dp[2] = 1;
	dp[3] = 1;

	// 全通り計算
	for(int i=1; i<=MAXN-3; i++){
		for(int j=1; j<=TOBIN; j++){
			dp[i+j] += dp[i];
		}
	}

	// 年数
	for(int i=1; i<=MAXN; i++){
		dp[i] = dp[i] / ofDay / YEAR;
		dp[i] += 1;
	}

	// 対話
	while( true ){
		int n;
		cin >> n;
		if( n == 0 )
			break;

		cout << dp[n] << endl;
	}

	return 0;
}