#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define vmax 10000
constexpr ll inf = 100000000000000;
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/

static const int N=30;
static const int W=10010;
int dp[N+1];

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

