#define _CRT_SECURE_NO_WARNINGS

#include<cstdio>
#include<algorithm>

#define N_MAX 30

int main(){
	while (1){
		int n, dp[N_MAX + 1];
		scanf("%d", &n);
		if (n == 0)
			break;
		for (int i = 0; i <= n; ++i)
			dp[i] = 0;

		for (int i = 1; i <= n; ++i){
			for (int j = 1; j <= 3; ++j){
				if (j >= i){
					dp[i] += dp[i - j];
				}
			}
		}
		int day = (dp[n] % 10 == 0) ? dp[n] / 10 : dp[n] / 10 + 1;
		int ans = (day % 365 == 0) ? day / 365 : day / 365 + 1;
		printf("%d",ans);
	}
	return 0;
}