L = int(input()) N = int(input()) S = input().split() num = (L - 3) / 3 ans = 8 ** num * len(S) print(int(ans))