#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <string.h>

#define loop(lp) for(int lp2 = 0; lp2 < lp; lp2 ++)
#define ascent(i, a, b) for(int i = a; i < b; i ++)

#define pb push_back

using namespace std;

int dp[50];

int main() {
  ascent(i, 1, 30+1) {
    if(i == 1) {
      dp[i] = 1;
    }
    else if(i == 2) {
      dp[i] = 2;
    }
    else if(i == 3) {
      dp[i] = 4;
    }
    else {
      dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
    }
  }

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