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

int main(){
        long long n;
        vector<long long> dp(31);
        for(int i = 0; i < 31; i++){
                if(i == 0) dp[i] = 1;
                else if(i == 1) dp[i] = dp[i - 1];
                else if(i == 2) dp[i] = dp[i - 2] + dp[i - 1];
                else dp[i] = dp[i - 3] + dp[i - 2] + dp[i - 1];
        }
        while(cin >> n && n > 0){
                long long day, year;
                if(dp[n] % 10 > 0) day = dp[n] / 10 + 1;
                else day = dp[n] / 10;
                if(day % 365 > 0) year = day / 365 + 1;
                else year = day / 365;
                cout << year << endl;
        }
        return 0;
}

