main=do [a,b]<-sequence[getLine,getLine]>>=return.map(read::String->Integer) print$8^(a`div`3-1)*b