#include<iostream>

using namespace std;

int main(){

	int n;

	while(n>0){

		cin >> n;

		int set = n / 3;
		int r = n % 3;
		int total = 0;

		while(set > 0){
			if(set == n / 3){total += 4;}
			else{
				total = total * 4 * 2 - 8;
			}
			set--;
		}

		if(n < 3){
			total += r;
		}
		else{
			if(r == 1){
				total = total * 2 - 1;
			}
			else if(r == 2){
				total = total * 4 - 3;
			}
		}

		int ans = total / 3650;

		if(total % 3650 != 0){
			ans++;
		}

		cout << ans << endl;

	}

	return 0;
}