#include<iostream>
using namespace std;
typedef int integer;

integer dp[50];

int main() {
  int n;
  while (cin >> n and n) {
    for (int i = 0; i < 40; i++) {
      dp[i] = 0;
    }

    dp[n] = 1;
    for (int i = n - 1; i >= 0; i--) {
      dp[i] = dp[i+1] + dp[i+2] + dp[i+3];
    }
    cout << (dp[0] + 3649) / 3650 << endl;
  }
}