program answer
  implicit none
  integer :: i, N, ans
  integer, allocatable :: A(:), B(:), C(:)
  read(*,*) N
  allocate(A(N),B(N),C(n-1))
  read(*,*) A
  read(*,*) B
  read(*,*) C

  ans=sum(B)
  do i = 1, N-1
     if(A(i+1)==A(i)+1) then
        ans=ans+C(A(i))
     end if
  end do

  write(*,*) ans

  stop
 end program answer