#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define fs first
#define sc second
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001


int main(){
    vector<int> dp(40);
    dp[0] = 1;
    for(int i=0; i<30; i++){
        dp[i+1] += dp[i];
        dp[i+2] += dp[i];
        dp[i+3] += dp[i];
    }
    
    while(1){
        int n; cin >> n;
        if(n==0) return 0;
        cout << ((dp[n] + 9)/ 10 + 364) / 365 << endl;
    }
    
    
    return 0;
}




