#include <iostream>
using namespace std;

int main(){
  long long dp[35] = {0LL};

  dp[0] = 1;

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

  int n;

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