fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val an = readLine()!!.split(" ").map(String::toInt)
    val bn = readLine()!!.split(" ").map(String::toInt)
    val cn = readLine()!!.split(" ").map(String::toInt)
    var ans = 0
    an.withIndex().forEach {
        ans += bn[it.value-1]
        if (it.index != 0 && (an[it.index-1]+1 == an[it.index])) {
            ans += cn[an[it.index-1] - 1]
        }
    }
    println(ans)
}
