#include<iostream>
#include<vector>
#include<string>
#include <cmath>
#define rep(i,n) for(int i = 0;i < (int)(n);i++)
using namespace std;


int state(int n) {
	long long dp[35];
	int ans = 0;
	rep(i, 35)dp[i] = 0;
	dp[0] = 1;
	rep(i, n) {
		dp[i + 1] += dp[i];
		dp[i + 2] += dp[i];
		dp[i + 3] += dp[i];
	}
	ans = ceil(double(dp[n]) / 3650.0);
	return ans;
}

int main() {
	int n, m, a = 0;
	cin >> n;
	do {
		cout << state(n) << endl;
		cin >> n;
	} while (n > 0);
	return 0;
}

