N=int(input()) K=int(input()) def f(p,d): L=len(p) q=[0]*(L+5) for i in range(L): n=p[i] if n: for j in range(6): q[i+j]+=d[j]*n return q d=[1]*6 k=[0]*3+[2]*3 p=[1] q=[1] for i in range(N): p=f(p,d) q=f(q,[d,k][i