#include <bits/stdc++.h>
using namespace std;

const long long INF = 1LL << 60;

long long dp[40];

long long rec(int i){
    if(i == 0) return 1;
    
    long long res = 0;
    for(int j = 1; j <= 3; j++){
        if(i - j >= 0) res += rec(i - j);
    }
    return dp[i] = res;
}

int main(){
  for(int i = 0; i < 40; i++){
    dp[i] = INF;
  }
    while(true){
        int n; cin >> n;
        if(n == 0) break;
        int tmp = rec(n);
        if(tmp % 3650 == 0){
            cout << tmp/3650 << endl;
        }
        else{
            cout << tmp/3650 + 1 << endl;
        }
    }
}
