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

int main() {
  long long dp[30];
  dp[0] = 1;
  dp[1] = 2;
  dp[2] = 4;
  for (int i = 3; i < 30; i++) {
    dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
  }
  int a[30];
  for (int i = 0; i < 30; i++) {
    cin >> a[i];
    if (a[i] == 0) {
      break;
    }
    else {
      int x = a[i];
      long long y = dp[x-1]/3650+1;
      cout << y << endl;
    }
  }
}
