#include <iostream>
#include <cstdlib>
#include <cmath>

using namespace std;
const static int STEP_NUM = 30;

int main() {
  int dp[ STEP_NUM + 1 ];
  dp[ 0 ] = 1;
  dp[ 1 ] = 1;
  dp[ 2 ] = 1 + dp[ 1 ];
  for( int i = 3; i <= STEP_NUM; i++ ) {
    dp[ i ] = dp[ i - 3 ] + dp[ i - 2 ] + dp[ i - 1 ];
  }
  while( true ) {
    int n;
    cin >> n;
    if( !n ) { return EXIT_SUCCESS; }
    cout << ceil( dp[ n ] / 3650.0 ) << endl;
  }

}