#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<n; ++i)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define F first
#define S second
#define PB push_back
#define MP make_pair 
using namespace std;
typedef unsigned long ul;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef pair<int, int> pi;
const int INF = 100100100;
const unsigned int MOD = 1000000007;

bool is_prime(int n) { for (int i = 2; i*i <= n; ++i) { if (n % i == 0) return false; } return true; }
template<class T> inline void chmin(T& a, T b) { if (a > b) { a = b; } }
template<class T> inline void chmax(T& a, T b) { if (a < b) { a = b; } }

// メモ化再帰
int rec(int n) {
}

int main() {
    
    for(;;) {
        ll dp[35];
        REP(i, 35) dp[i] = INF;
        dp[0] = 1;
        dp[1] = 2;
        dp[2] = 4;
        
        int N; cin >> N;
        if(N == 0) break;
        
        for(int i = 3; i < N; ++i) {
            dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]; 
        }
        
        cout << dp[N - 1]/10/365 + 1 << endl;
        
    }
}
