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

using i64 = int64_t;

int main(){
    int n;
    while(cin >> n, n != 0){
        vector<i64> dp(n+4);
        dp[0] = 1;
        for(int i=0;i<n;++i){
            dp[i+1] += dp[i];
            dp[i+2] += dp[i];
            dp[i+3] += dp[i];
        }
        cout << (dp[n] + 3649) / 3650 << endl;
    }

    return 0;
}

