#include <iostream>
#include <vector>
#include <cfenv>
#include <cmath>
using namespace std;

int main() {
    while(1) {
        int n;
        cin >> n;
        if(n == 0) break;

        vector<float> step(3);
        step[0] = 1;
        step[1] = 2;
        step[2] = 4;

        for(int i = 3; i < n; i++) {
        int count = step[i-3] + step[i-2] + step[i-1];   
        step.push_back(count);
        }

        cout << ceil(step[n-1]/10/365) << endl;
        step.clear();
    }

return 0;
}
