#include <iostream>
using namespace std;

const int LIMIT = 31;

int main()
{
	int dp[ LIMIT ][ LIMIT ] = {0};
	int ans[ LIMIT ] = {0};

	dp[ 0 ][ 0 ] = 1;

	for( int i = 1; i < LIMIT; ++i ){
		for( int j = 0; j < 3; ++j ){
			for( int k = 0; k < i * 2 - 1; ++k ){
				int p = i + j + k;
				if( p >= LIMIT ) continue;
				dp[ i ][ p ] += dp[ i - 1 ][ i - 1 + k ];
				ans[ p ] += dp[ i - 1 ][ i - 1 + k ];
			}
		}
	}

	int n;
	while( cin >> n && n ){
		cout << ans[ n ] / 3650 + ( ans[ n ] % 3650 > 0 ? 1 : 0 ) << endl;
	}

	return 0;
}