gets
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
c = gets.split.map(&:to_i)
sum = 0
(a.size).times{|i|
    sum += b[a[i]-1]
}
(a.size - 1).times{|i|
    sum += c[a[i]-1] if a[i] + 1 == a[i + 1]
}
puts sum