#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#define rep(i,n) for (int i = 0; i < (n); ++i)

using namespace std;
const int MOD = 1000000007;

typedef long long int ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

int solve(vector<int> &dp,int n) {
    if(n==0)return 1;
    if(dp[n]!=0)return dp[n];
    dp[n] =  solve(dp,n-3) +solve(dp,n-2) + solve(dp,n-1);
    return dp[n]; 
}

int main() {
    vector<int> dp(31,0);
    int n;
    cin >> n;
    dp[1]=1;dp[2]=2;dp[3]=4;

    while(n){
        cout << ((solve(dp,n)/10)/365)+1  << endl;
        cin >> n;
    }
    return 0;
}

