program main
    implicit none
    integer:: n, i
    integer, allocatable:: a(:), b(:), c(:)
    integer:: sat

    read*, n

    allocate(a(n), b(n), c(n-1))

    read*, a(1:n)
    read*, b(1:n)
    read*, c(1:n-1)

    sat = sum(b(1:n))
    do i = 1, n-1
        if (a(i+1) - a(i) == 1)then
            sat = sat + c(a(i))
        endif
    end do

    print*, sat

end program