#include <iostream>
using namespace std;
#define MAX 30

int main(void){
    int n,dp[MAX+1];
    dp[0] = 0; dp[1] = 1; dp[2] = 2; dp[3] = 4;
    
    for(int i = 4 ; i < MAX+1 ; i++) dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
    while(1){
        cin >> n;
        if(!n) break;
        
        cout << dp[n]/10/365+1 << endl;
    }
    
    return 0;
}