program buffet
  implicit none
  integer :: n, a(20) = 0, b(20) = 0, c(19) = 0, ans, i
  read(*,*) n
  read(*,*) a(1:n)
  read(*,*) b(1:n)
  read(*,*) c(1:n-1)
  ans = b(a(1))
  do i = 2, n
    if (a(i) == a(i-1)+1) ans = ans+c(a(i-1))
    ans = ans+b(a(i))
  end do
  write(*,'(i0)') ans
end program buffet