#include <iostream>

using namespace std;

int main()
{
    int n;
    while (cin >> n && n)
    {
        int a = 1;
        int b = 2;
        int c = 4;
        int sum;
        int answer;
        for (int i = 4; i <= n; i++)
        {
            sum = a + b + c;
            a = b;
            b = c;
            c = sum;
        }
        if (n <= 3)
        {
            answer = 1;
        }
        else
        {
            answer = (sum / +10) / 365;
            if (sum % 3650 != 0)
            {
                answer += 1;
            }
        }

        cout << answer << endl;
    }
}

