'use strict'
function main(arg) {
  const args = arg.split(/\r\n|\r|\n/).map(a => a.split(' ').map(Number))
  let index = 0
  let result = 0
  let prev = 0
  while (args[0] > index) {
    const current = args[1][index]
    result += args[2][current - 1]

    if (index > 0 && prev === current - 1) {
      result += args[3][current - 2]
    }

    prev = current
    index++
  }

  console.log(result)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));