#include <iostream>

using namespace std;

int main()
{
    int a[31] = { 0, 1, 2, 4 };
    for( int i=4; i<=30; ++i ) {
        a[i] = a[i-1] + a[i-2] + a[i-3];
    }

    int n;
    while( cin >> n ) {
        if ( n == 0 )
            break;

        cout << ( a[n] < 10 ? 1 : (( a[n] / 10 / 365 ) + ( a[n] / 10 % 365 != 0 ) )) << endl;
    }
}