fun main() {
  val N = readInt()
  val A = readInts()
  val B = readInts()
  val C = readInts()
  var sum = 0
  A.forEachIndexed { i, a ->
    sum += B[a - 1]
    if (A.getOrNull(i - 1) == a - 1) sum += C[a - 2]
  }
  println(sum)
}

fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readLong() = readString().toLong()
fun readInts() = readStrings().map { it.toInt() }
fun readLongs() = readStrings().map { it.toLong() }
