#include<iostream>
#include<cmath>

int n;
int a[31];

int main()
{
	a[0] = 1;
	a[1] = 1;
	a[2] = 2;

	for( int i = 3; i <= 30; ++i )
		a[i] = a[i-1] + a[i-2] + a[i-3];

	while( std::cin >> n, n )
		std::cout << ceil( a[n] / 10.0 / 365.0 ) << std::endl;

	return 0;
}