let () = Scanf.scanf "%d\n" @@ fun n ->
  let as_ = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun a -> a - 1 in
  let bs = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun b -> b in
  let cs = Array.init (n - 1) @@ fun _ -> Scanf.scanf "%d " @@ fun c -> c in
  Printf.printf "%d\n" @@
  Array.fold_left ( + ) 0 @@
  Array.init n @@ fun i ->
    bs.(as_.(i)) +
    if i <> 0 && as_.(i - 1) + 1 = as_.(i)
    then cs.(as_.(i - 1))
    else 0

