program bbb

implicit none
integer :: i, n, res
integer, allocatable, dimension(:)  :: a, b, c

read(*,*) n

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

read(*,*) a
read(*,*) b
read(*,*) c

res = b(1)

do i = 2, n
res = res + b(i)
if ((a(i)-a(i-1))==1) then
res = res + c(a(i-1))
end if
end do

write(*,'(i0)') res

end program
