// Slower C++ solution:
#include <iostream>

#include <string>

#include <vector>

#include <algorithm>

#include <cmath>

#include <cstdio>

#include <functional>

#include <numeric>

#include <stack>

#include <queue>

#include <map>

#include <set>

#include <utility>

#include <sstream>

#include <complex>

#include <fstream>

#include <bitset>

#include <time.h>

#include <tuple>



using namespace std;



typedef long long ll;

typedef pair<ll, ll> P;

typedef vector<ll> V;

typedef complex<double> Point;



#define PI acos(-1.0)

#define EPS 1e-10

const ll INF = 1e12;

const ll MOD = 1e9 + 7;



#define FOR(i,a,b) for(int i=(a);i<(b);i++)

#define rep(i,N) for(int i=0;i<(N);i++)

#define ALL(s) (s).begin(),(s).end()

#define EQ(a,b) (abs((a)-(b))<EPS)

#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )

#define fi first

#define se second

#define N_SIZE (1LL << 20)

#define NIL -1



ll sq(ll num) { return num*num; }

ll mod_pow(ll x, ll n) {

	if (n == 0)return 1;

	if (n == 1)return x%MOD;

	ll res = sq(mod_pow(x, n / 2));

	res %= MOD;

	if (n % 2 == 1) {

		res *= x;

		res %= MOD;

	}

	return res;

}

ll mod_add(ll a, ll b) { return (a + b) % MOD; }

ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }

ll mod_mul(ll a, ll b) { return a*b % MOD; }



ll n;



ll solve(int now) {

	if (now == 0)return 1;

	if (now < 0)return 0;

	ll res = 0;

	res = solve(now - 1) + solve(now - 2) + solve(now - 3);

	return res;

}



int main() {

	while (cin >> n&&n) {

		cout << solve(n) / 3650 + 1 << endl;

	}

}

// Faster C++ solution for the same problem (measured speedup: 3.6490582784156484x):
#include <iostream>

#include <string>

#include <vector>

#include <algorithm>

#include <cmath>

#include <cstdio>

#include <functional>

#include <numeric>

#include <stack>

#include <queue>

#include <map>

#include <set>

#include <utility>

#include <sstream>

#include <complex>

#include <fstream>

#include <bitset>

#include <time.h>

#include <tuple>



using namespace std;



typedef long long ll;

typedef pair<ll, ll> P;

typedef vector<ll> V;

typedef complex<double> Point;



#define PI acos(-1.0)

#define EPS 1e-10

const ll INF = 1e12;

const ll MOD = 1e9 + 7;



#define FOR(i,a,b) for(int i=(a);i<(b);i++)

#define rep(i,N) for(int i=0;i<(N);i++)

#define ALL(s) (s).begin(),(s).end()

#define EQ(a,b) (abs((a)-(b))<EPS)

#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )

#define fi first

#define se second

#define N_SIZE (1LL << 20)

#define NIL -1

#define MAX_N 100100



ll sq(ll num) { return num*num; }

ll mod_pow(ll x, ll n) {

	if (n == 0)return 1;

	if (n == 1)return x%MOD;

	ll res = sq(mod_pow(x, n / 2));

	res %= MOD;

	if (n % 2 == 1) {

		res *= x;

		res %= MOD;

	}

	return res;

}

ll mod_add(ll a, ll b) { return (a + b) % MOD; }

ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }

ll mod_mul(ll a, ll b) { return a*b % MOD; }



ll n;

ll memo[100];



ll solve(int now) {

	if (now == 0)return 1;

	if (now < 0)return 0;

	if (memo[now] != -1)return memo[now];

	return memo[now] = solve(now - 1) + solve(now - 2) + solve(now - 3);

}



int main() {

	fill(memo, memo + 100, -1);

	solve(30);

	while (cin >> n&&n) {

		cout << memo[n] / 3650 + 1 << endl;

	}

}