    #include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>

    using namespace std;
    using Graph = vector<vector<int>>;

    #define INF 10000000
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))

    const int dx[4] = {1,0,-1,0};
    const int dy[4] = {0,1,0,-1};
    
    
    
    int main(){
      int n;
      int year = 3650;
      while(cin>>n){
      if(n==0)break;
      long long dp[n];

      

      int j=0;
      dp[0] = 1;
      dp[1] = 1;
      dp[2] = 2;
      REP(i,3,n){
        dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
      }
      int res;
      if(dp[n]%year)res = dp[n]/year+1;
      else res = dp[n]/year;
      cout << res <<endl;
      }
    }

      
      

     
    

    

     
