let () = Scanf.scanf "%d\n" @@ fun n ->
  let aa = Array.init n @@ fun _ -> Scanf.scanf " %d" (fun e -> e - 1) in
  let bb = Array.init n @@ fun _ -> Scanf.scanf " %d" Fun.id in
  let cc = Array.init n @@ fun _ -> Scanf.scanf " %d" Fun.id in
  let ans = ref 0 in
  for i = 0 to n - 1 do
    if i = 0 then ans := !ans + bb.(aa.(i))
    else if aa.(i) = aa.(i - 1) + 1 then ans := !ans + bb.(aa.(i)) + cc.(i - 1)
    else ans := !ans + bb.(aa.(i))
  done;
  Printf.printf "%d\n" !ans