program main

  integer :: N, add

  integer, allocatable, dimension ( : ) :: A, B, C, D

  read ( *, * ) N

  allocate ( A ( 1:N ) )

  allocate ( B ( 1:N ) )

  allocate ( C ( 1:N-1 ) )

  allocate ( D ( 1:N-1 ) )      

  read ( *, * ) A ( 1:N )
  read ( *, * ) B ( 1:N )
  read ( *, * ) C ( 1:N-1 )


  add = 0
  
  do i = 1, N - 1
  
     if ( A ( i + 1 ) - A ( i ) == 1 ) then

        add = add + C ( A ( i ) )

     end if

  end do

  print '(i0)', add + sum ( B ( 1:N ) )

end program main
