solve :: [(Int, Int)] -> Int -> [Int] -> [Int] -> Int
solve [] _ _ _ = 0
solve ((i, a):as) prev bs cs = st + ad + solve as a bs cs 
  where st = bs !! (i - 1)
        ad = if a == prev + 1 then cs !! (a - 2) else 0

main :: IO ()
main = do
  getLine
  as <- map read . words <$> getLine
  bs <- map read . words <$> getLine
  cs <- map read . words <$> getLine
  print $ solve (zip [1..] as) 100 bs cs
