#include<bits/stdc++.h>
using namespace std;


const long long INF = 1LL << 60;
#define MOD 1000000007;

typedef long long ll;

#define writeln(n) cout<<n<<endl;

typedef pair<int, int> P;

ll dp[100];

int main() {


	int n;

	int dp[50] ={0};
	dp[0] =1;
	dp[1] =2;
	dp[2] =4;

	for(int i=3; i<31; i++){
		dp[i] = dp[i-1]+dp[i-2]+dp[i-3];

	}

	while(1){
		cin>>n;
		if(n ==0){
			break;
		}


		int ans = dp[n-1]/3650;

		if(dp[n-1]%3650 >0 )ans++;

		writeln(ans);


	}




}


