#include <iostream>
#include <cstring>
using namespace std;

unsigned long long memo[31];

int recursion(int n){
  if(n <= 0) return 1;
  if(memo[n] != 0) return memo[n];
  return memo[n] = recursion(n-3) + recursion(n-1) + recursion(n-2);
}

int main(){
  int n;
  while(cin >> n,n){
    memo[1] = 1;
    memo[2] = 2;
    memo[3] = 4;
    recursion(n);
    cout << ((memo[n]%3650 == 0)? memo[n]/3650 : memo[n]/3650 +1) << endl;
  }
}