 #include <iostream>
 #include <vector>
 #include <map>
 #include <string>
 #include <algorithm>
 using namespace std;

 template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

 typedef long long ll;
 const long long INF = 1LL << 60;



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

        vector<ll> dp(n+1, 0);
        dp.at(0) = 1;

        for(int i = 1; i < n+1; i++)
        {
            dp.at(i) += (ll)(dp.at(i-1));
            if(i > 1) dp.at(i) += (ll)(dp.at(i-2));
            if(i > 2) dp.at(i) += (ll)(dp.at(i-3));
        }

        dp.at(n) = (dp.at(n) + 10 - 1) / 10;
        ll ans = (ll)(dp.at(n) + 365 - 1) / 365;
        cout << ans << endl;
    }



    return 0;
 }
