def main(): l = int(input()) n = int(input()) s = input().split() print(2 ** (l - len(s[0])) * len(s)) if __name__ == '__main__': main()