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 $ map winPoint xs
  where xs = map winHand us ++ zipWith f xs vs
        (us, vs) = splitAt k ts
        winHand 'r' = 'p'
        winHand 's' = 'r'
        winHand 'p' = 's'
        winPoint 'r' = r
        winPoint 's' = s
        winPoint 'p' = p
        winPoint 'x' = 0
        f x v
          | x == y    = 'x'
          | otherwise = y
          where y = winHand v

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