import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int L = sc.nextInt(); final int N = sc.nextInt(); long count = 0; for(int i = 0; i < N; i++){ final String S = sc.next(); count += 1l << (L - 3); } System.out.println(count); } }