#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

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

	for(int n; cin >> n, n;) {
		vector<int> dp(n + 1, 0);
		dp[0] = 1;
		for(int i = 0; i < dp.size(); ++i)
			for(int j = i + 1; j < dp.size() && j < i + 4; ++j)
				dp[j] += dp[i];

		int day = dp[n] / 10 + (dp[n] % 10 ? 1 : 0);
		int year = day / 365 + (day % 365 ? 1 : 0);
		cout << year << endl;
	}


	return EXIT_SUCCESS;
}