lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

sum = 0
a_j = lines[0].first

lines[1].each {|a_i|
  sum += lines[2][a_i - 1]
  sum += lines[3][a_j - 1] if a_i == (a_j + 1)
  a_j = a_i
}

puts sum