fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map(String::toInt)
    val B = readLine()!!.split(" ").map(String::toInt)
    val C = listOf(0) + readLine()!!.split(" ").map(String::toInt)
    val ans = B.sum() + (0 until A.size - 1).map { if (A[it] + 1 == A[it + 1]) C[A[it]] else 0 }.sum()
    println(ans)
}