#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <cctype>

#include <iostream>
#include <vector>
#include <deque>
#include <queue>
#include <map>
#include <algorithm>


using namespace std;

#define Max INT_MAX
#define Inf (INT_MAX/2)
#define Min INT_MIN


#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i,l,n) for(int (i)=(int)(l);(i)<(int)(n);(i)++)
// s <= x < g ?
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
// 0 <= x < w && 0 <= y < h ?
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))

typedef pair<int, int> P;

int main()
{
    int n;
    long long dp[30] = {0};
    while( cin >> n ){
        if( n == 0 ) { break;}
        rep(i,30){
            dp[i] = 0;
        }
        rep(i,3){
            dp[i] = 1;
        }
        repi(i,0,30){
            if( IN(i-1,0,30) ) { dp[i] += dp[i-1];}
            if( IN(i-2,0,30) ) { dp[i] += dp[i-2];}
            if( IN(i-3,0,30) ) { dp[i] += dp[i-3];}
        }

        //rep(i,30){
        //    cout << dp[i] << ",";
        //}

        long long sum = 0;

        //cout << "dp[29] = " << dp[29] << endl;
        sum = dp[n-1];
        int ans = sum / 3650;
        if( !(sum % 3650 == 0) ) { 
            ans++;
        } 
        cout << ans << endl;
    }
}