#include<iostream>
#include<algorithm>
using namespace std;

int main(){
  int n;
  long long int ans[30];
  for(int i =0;i < 30; i++){
    if(i == 0)ans[i] = 1;
    else if(i == 1)ans[i] = ans[i-1] + 1;
    else if(i == 2)ans[i] = ans[i-1] + ans[i-2] + 1;
    else ans[i] = ans[i-1] + ans[i-2] + ans[i-3];
  }
  while(1){
    cin >> n;
    if(n == 0)break;
    if(ans[n-1]%3650 == 0) cout<<ans[n-1]/3650 << endl;
    else  cout << ans[n-1]/3650 + 1 <<endl;
  }
}


