#include <iostream>
using namespace std;
#define MAX 31

int main(){
  int n,dp[MAX];

  dp[1] = 1; dp[2] = 2; dp[3] = 4;
  for(int i = 4 ; i < MAX ; i++)
    dp[i] = dp[i-1]+dp[i-2]+dp[i-3];

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

  return 0;
}