#define _LIBCPP_DEBUG 0
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1e9+7;

int main() {

    while(true){
        int dansu;
        cin>>dansu;
        if(dansu==0) break;

        vector<double> dp(31, 0);
        dp[0]=1;
        dp[1]=1;
        dp[2]=2;
        for (int i = 2; i <= dansu; ++i) {
            dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
        }
        cout<<ceil(dp[dansu]/10/365)<<endl;
    }

    return 0;
}
