#include<cstdio>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int n,ans,i,j,dp[31],MAX,day;
	while(1){
		scanf("%d",&n);
		if(n==0){
			break;
		}
		for(i=0;i<=30;i++){
			dp[i]=0;
		}
	dp[0]=1;
	MAX=0;
	for(i=0;i<=n;i++){
		for(j=1;j<=3;j++){
			dp[i+j]+=dp[i];
		}
	}
	day=dp[n]/10;
	if(dp[n]%10!=0){
		day++;
	}
	ans=day/365;
	if(day%365!=0){
		ans++;
	}
	printf("%d\n",ans);
	}
	return 0;
}
