L=int(input ()) L//=3 N=int(input()) S=input (). split () A=1 for i in range(L-1): A*=8 A*=N print (A)