#include <iostream>
#include <cmath>
int n;

int cnt(int i){
	if(i == 1)	return 1;
	if(i == 2)	return 2;
	if(i == 3)	return 4;

	return cnt( i-3 ) + cnt( i-2 ) + cnt( i-1 );
}


int main(void){
	while(1){
		std::cin >> n;
		if(n == 0)	return 0;
		std::cout << std::ceil(cnt(n) / 10.0 / 365.0) << std::endl;
	}
}
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;

int main(){
	int N;
	while(cin>>N,N){
		int dp[31] = {}; dp[0] = 1;
		for(int i=0;i<N;i++){
			for(int j=1;j<=3;j++) if(i+j<=N) dp[i+j] += dp[i];
		}
		printf("%d\n",((dp[N]-1)/10)/365+1);
	}
	return 0;
}