#include <iostream>
using namespace std;
int main(void){
    int n;
    cin >> n;
    while(n != 0){
        int a[31] = {};
        a[1] = 1;
        a[2] = 2;
        a[3] = 4;
        for(int i = 4; i < 31; i++){
            a[i] = a[i-1] + a[i-2] + a[i-3];
        }
        cout << ((a[n]/10)/365)+1 << endl;
        cin >> n;
    }
}
