program test
implicit none
  integer,allocatable::a(:),b(:),c(:)
  integer :: N,i,ans
  read*,N
  allocate(a(N))
  allocate(b(N))
  allocate(c(N-1))
  read(*,*)(a(i),i=1,N)
  read(*,*)(b(i),i=1,N)
  read(*,*)(c(i),i=1,N-1)
  ans=0
  do i=1,N
  	if(a(i+1)==a(i)+1)then
  		ans=ans+b(a(i))+c(a(i))
    else 
    	ans=ans+b(a(i))
    end if
  
  end do
 print*,ans
end program
  