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

#define int				long long
#define FOR( i, m, n )	for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )		FOR( i, 0, n )
#define REPR( i, m )	for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )	FOR( i, 1, n + 1 )
#define ALL( a )		(a).begin(), (a).end()
#define MP				make_pair

typedef pair<int, int> P;

template<class T>bool chmax( T& a, const T& b ) { if( a < b ) { a = b; return 1; } return 0; }
template<class T>bool chmin( T& a, const T& b ) { if( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e9;
const int MOD = 1e9 + 7;

int dp[31];

signed main(){
	dp[0] = dp[1] = 1;
	dp[2] = 2;
	FOR( i, 3, 31 ) {
		dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3];
	}

	int n;
	while( cin >> n, n ) {
		cout << dp[n] / 10 / 365 + 1 << endl;
	}

}

