#include <iostream>
using namespace std;

int method[30];

int recursion(int num) {
    if (num == 0) {
        return 1;
    } else if (num == 1) {
        return 1;
    } else if (num == 2) {
        return 2;
    } else {
        return recursion(num-1) + recursion(num-2) + recursion(num-3);
    }
}

int main() {
    while (1) {
        int n;
        cin >> n;
        if (n == 0) {
            return 0;
        } else {
            cout << (recursion(n) + 1) / 3650 + 1 << endl;
        }
    }
}

// cin: 入力
// cout: 出力
// endl: 改行
