#include <iostream>

using namespace std;

int main()
{
    unsigned long dp[31] = { 1, 1, 2 };
    for( int i=3; i<31; ++i )
        dp[i] = dp[i-3] + dp[i-2] + dp[i-1];

    int n;
    while( cin >> n ) {
        if ( n == 0 )
            break;
        cout << dp[n] / 3650 + ( dp[n] % 3650 != 0 ) << endl;
    }
}