#include<bits/stdc++.h>
using namespace std;

int dp[31];

int main(){
  dp[0] = 1;
  for(int i=0;i<30;i++){
    for(int j=1;j<=3;j++){
      if(i+j<=30)dp[i+j] += dp[i];
    }
  }

  int n;
  while(cin >> n, n){
    cout << ((dp[n]+9)/10+364)/365 << endl;
  }
}