fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    val a = readLine()?.split(" ")?.map(String::toInt) ?: return
    val b = readLine()?.split(" ")?.map(String::toInt) ?: return
    val c = readLine()?.split(" ")?.map(String::toInt) ?: return

    var total = 0
    0.until(n).forEach {
        total += b[a[it] - 1]
        if (it > 0 && a[it] - a[it - 1] == 1) {
            total += c[a[it - 1] - 1]
        }
    }
    println(total.toString())
}