# frozen_string_literal: true l = gets.chomp.to_i _ = gets s = gets.chomp.split.map(&:chars) p s.size * 2**(l - 3)