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

vector<long long> step_pattern(30,0);

int steps(int n){
    int s;
    if(step_pattern.at(n-1)!=0){
        s=step_pattern.at(n-1);
    }else{
        s=steps(n-1)+steps(n-2)+steps(n-3);
        step_pattern.at(n-1)=s;
    }
    return s;
}

int main(){
    step_pattern.at(0)=1;
    step_pattern.at(1)=2;
    step_pattern.at(2)=4;
    int n;
    vector<int> answers;
    while(cin >> n && n!=0){
        int years=steps(n)/3650;
        if(steps(n)%3650!=0){
            years++;
        }
        answers.push_back(years);
    }
    for(int i=0;i<answers.size();i++){
        cout << answers.at(i) << endl;
    }
    return 0;
}

