#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

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

	while(1){
		int n; cin >> n;
		if(n == 0) break;
		vector<ll> dp(31,-1);
		dp[0] = 1;
		dp[1] = 1;
		dp[2] = 2;
		dp[3] = 4;
		for (int i = 4;i <= n;i++){
			dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
		}	
	
		ll day = (dp[n]-1)/10 + 1;
		cout << ((day - 1)/365 + 1) << endl;
	}

	return 0;

}

