#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<random>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
//const int inf = 1e9 + 7;
//int dy[] = {0, 0, -1, 1};
//int dx[] = {1, -1, 0, 0};

int main() {
    int numstages;
    while (cin >> numstages && numstages) {
        int dp[numstages]; rep(i, numstages + 1) dp[i] = 0;
        dp[1] = 1;
        dp[2] = 2;
        dp[3] = 4;
        rrep(i, 4, numstages + 1) {
            dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3];
        }
        cout << dp[numstages] / 365 / 10 + 1 << endl;
    }
}

