score :: [Int] -> [Int] -> Int
score c a = snd $ foldl step (-1, 0) a
    where step (y, a) x = (x, a + if x == y+1 then (c!!(y-1)) else 0)

main = do
  n <- readLn :: IO Int
  a <- map read . words <$> getLine :: IO [Int]
  b <- map read . words <$> getLine :: IO [Int]
  c <- map read . words <$> getLine :: IO [Int]
  putStrLn . show $ score c a + foldl (+) 0 b
