#include<iostream>
using namespace std;

int main(){
	int n;
	int m[30] = {1, 1, 2};

		for(int i= 3; i < 30; i++){
			m[i] = m[i-1] + m[i-2] + m[i-3];
		}
	while(cin >> n, n){
		cout << m[n] / (365 * 10) + 1 << endl;
	}
}