fun main(args: Array<String>) {
    readLine()!!.toInt()
    val A = readLine()!!.split(" ").map(String::toInt)
    val B = readLine()!!.split(" ").map(String::toInt)
    val C = readLine()!!.split(" ").map(String::toInt)
    var old = 100000
    var p = 0
    for (a in A) {
        val i = a - 1
        p += B[i]
        if (i == old + 1) p += C[i-1]
        old = i
    }
    println(p)
}