#include <iostream>
#include <vector>
#include <cstdlib>

using namespace std;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

const long long INF = 1LL << 60;

#define MOD 1000000007

int N;

int main(){

    int n;

    cin >> n;

    vector<int> nlist;

    while(n != 0){
        nlist.push_back(n);
        cin >> n;
    }

    vector<int> res(30+1, 0);

    res[0] = 0;
    res[1] = 1;
    res[2] = 2;
    res[3] = 4;

    for(int i = 4; i <= 30; i++){
        res[i] = res[i-3] + res[i-2] + res[i-1];
    }

    for(int i = 0; i < nlist.size(); i++){
        cout << res[nlist[i]]/(365*10) + 1 << endl;
    }
}
