#include<bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)

typedef long long ll;

int main() {
    int dp[31];
    dp[0] = 1;
    dp[1] = 1;
    dp[2] = 2;
    for(int i=3;i<=30;i++){
        dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
    }
    int n;
    while(cin >> n, n){
        cout << dp[n]/365/10+1 << endl;
    }
}
