#include <iostream>
using namespace std;
int main(){
  int n;
  int dp[31];
  int ans;
  dp[0] = dp[1] = 1;
  dp[2] = 2;
  while(cin >> n,n){
    
    for(int i = 2 ; i < n ; i++){
      dp[i + 1] = dp[i] + dp[ i - 1] + dp[i - 2];
    }
    ans = dp[n]/3650 + 1;
    
    cout << ans << endl;
    
  }
  return 0;
}