n = gets.to_i
foods = []
3.times { foods << gets.split(' ').map(&:to_i) }

count = 0
n.times do |i|
  num = foods[0][i]
  count += foods[1][num-1]
  if  num == foods[0][i-1] + 1 && i > 0
    count += foods[2][num-2]
  end
end

puts count
