#include <cstdio>


int dp[35];


int main(){
    int n;
    while(scanf("%d",&n)&&n>0){
        for(int i=0;i<=34;i++) dp[i]=0;
        dp[0]=1;
        for(int cur=0;cur<=n;cur++){
            for(int step=1;step<=3;step++) dp[cur+step]+=dp[cur];
        }



        printf("%d\n",(dp[n]/3650)+(dp[n]%3659?1:0));
    }


    return 0;
}
