L=int(input()) N=int(input()) A=list(input().split()) ans=0 for i in range(N): ans+=(2**(L-len(A[i]))) print(ans)