#include <bits/stdc++.h>
using namespace std;

int main(){
        
    vector<int> dp(35,0);

    dp[0] = 1;

    for(int i=0; i<=30; i++){
        for(int j=1; j<=3; j++){
            dp[i+j] += dp[i];
        }
    }

    while(1){
        int N;
        cin>>N;
        if(N == 0) break;
        cout<<(dp[N]+365*10-1)/(365*10)<<endl;
    }

    return 0;
}
