#include <iostream>
#include <algorithm>

#define INF 1 << 30;
#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

int main(){

	int n;
	while(cin >> n && n){
		// 段数
		int dp[32];
		rep(i, n) dp[i] = INF;
		
		dp[0] = 1;
		dp[1] = 2;
		dp[2] = 4;

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

		cout << dp[n-1]/365/10  + 1<< endl;
	}
	return 0;
}