import { readFileSync } from 'fs'
function main() {
  const input = readFileSync('/dev/stdin', 'utf8')
  const [n, a, b, c] = input.trim().split('\n').map(v => v.trim().split(' ').map(string => parseInt(string))) 
  console.log(n, a, b, c)
  let result = 0  
  for (let i = 0; i < a.length; i++) {
    const number = a[i] - 1
    result += b[number]
    if (number !== a.length && i + 1 !== a.length && a[i] + 1 === a[i + 1]) {
      result += c[number]
    }
  }
  console.log(result)
}
main()