#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	
	int n;
	int a[31];
	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 (cin>>n&&n){
		cout<<(a[n]+3649)/3650<<endl;
	}
}
