main :: IO ()
main = do
  [n, k] <- readsLn
  [r, s, p] <- readsLn
  ts <- getLine
  print $ solve n k r s p ts

solve :: Int -> Int -> Int -> Int -> Int -> String -> Int
solve _ k r s p ts = sum xs
  where xs = map winPoint us ++ zipWith (\u v -> let x = winPoint v in if u == x then 0 else x) xs vs
        (us, vs) = splitAt k ts
        winPoint 'r' = p
        winPoint 's' = r
        winPoint 'p' = s

readsLn :: Read a => IO [a]
readsLn = map read . words <$> getLine
