#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MOD (1000000007)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int calcYear(int date){
    if(date % 10 == 0) date /= 10;
    else date = (date / 10) + 1;

    if(date % 365 == 0) return date / 365;
    else return (date / 365) + 1;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int dp[40];
    dp[0] = 1;
    dp[1] = 1;
    dp[2] = 2;
    for(int i=3;i<31;i++){
        dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
    }
    int n;
    vector<int> ans;
    while(1){
        cin >> n;
        if(n == 0) break;
        ans.push_back(dp[n] / 3650 + 1);
    }
    for(int i=0;i<ans.size();i++) cout << ans[i] << endl;
}
