fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val aa = readLine()!!.split(" ").map { it.toInt() - 1 }
    val bb = readLine()!!.split(" ").map { it.toInt() }
    val cc = readLine()!!.split(" ").map { it.toInt() }
    var result = bb[aa[0]]
    var prevA = aa[0]

    for ( i in 1 until n) {
        result += bb[aa[i]] + if (aa[i] - prevA == 1) cc[prevA] else 0
        prevA = aa[i]
    }

    println(result)
}