import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); int L = Integer.parseInt(reader.readLine()); int N = Integer.parseInt(reader.readLine()); String[] inputs = reader.readLine().split(" "); int sum = 0; for (int i = 0; i < N; i++) { String pattern = inputs[i]; int diff = L-pattern.length(); int m =(int) Math.pow(2,diff); sum+=m; } System.out.println(sum); } }