#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <functional>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 100000000
template<class T, class C> void chmax(T& a, C b) { a>b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a<b ? : a = b; }

int main() {
	while (true) {
		int n;
		long long dp[31] = { 0 };
		cin >> n;
		if (n == 0) return 0;
		dp[0] = 1;
		for (int i = 1; i <= n; i++) {
			dp[i] += dp[i - 1];
			if (i - 2>=0) dp[i] += dp[i - 2];
			if (i - 3>=0) dp[i] += dp[i - 3];
		}
		cout << (dp[n] / 3650) + 1 << endl;
	}
	return 0;
}