#include <iostream>
using namespace std;
int main()
{
    int N;
    long long A[31];
    while((cin >> N)&&(N > 0))
    {
        for(int i = 0; i <= N; i++)
        {
            if(i == 0)
            {
                A[i] = 1;
            }
            else if(i == 1)
            {
                A[i] = A[i-1];
            }
            else if(i == 2)
            {
                A[i] = A[i-1] + A[i-2];
            }
            else
            {
                A[i] = A[i-1] + A[i-2] + A[i-3];
            }
        }

        cout << (((A[N] + 9) / 10) + 364) / 365 << endl;

    }
    return 0;
}
