module Enumerable
  def balance(n)
    Array.new(n) { [] }.tap { |ary| zip(ary.cycle) { |e, a| a << e } }
  end
end

n, k = gets.split.map(&:to_i)
r, s, p = gets.split.map(&:to_i)
$points = { r: p, s: r, p: s }
ts = gets.chomp.each_char.map(&:to_sym).balance(k)

def f(t)
  t.chunk(&:itself).inject(0) do |sum, (sym, ary)|
    sum + (ary.size + 1) / 2 * $points[sym]
  end
end

puts ts.inject(0) { |sum, t| sum + f(t) }
