      program answer
        implicit none
        integer :: i,N
        integer,allocatable,dimension(:) :: A,B,C
        integer :: ans
        ans = 0
        read(*,*) N
        allocate(A(N),B(N),C(N))
        read(*,*) (A(i),i=1,N)
        read(*,*) (B(i),i=1,N)
        read(*,*) (C(i),i=1,N-1)
        do i=1,N
          ans = ans + B(A(i))
          if(i .gt. 1) then
            if((A(i-1)+1) == A(i)) then
              ans = ans + C(A(i-1))
            end if
          end if
        end do
        write(*,'(I0)') ans
        stop
      end program answer
