#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int N = 1000000;
const ll mod = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
 
ll dp[35]; 
ll DP(ll m){
    dp[0] = 1, dp[1] = 2, dp[2] = 4;
    rep(i, 31){
        dp[i + 3] = dp[i] + dp[i + 1] + dp[i + 2];
    }
    return dp[m - 1];
}

int main(){ 
    while(true){
        int n; cin >> n;
        if(n == 0){
            break;
        }
        int ans = (DP(n) / 10) / 365 + 1;
        cout << ans << endl;
    }
}

