fun main(args: Array<String>) {
    readLine()
    val readInts = { readLine()!!.split(" ").map { it.toInt() } }
    val al = readInts()
    val bl = readInts()
    val cl = readInts()
    val sum = bl.sum()
    var bonus = 0
    for (a in al.withIndex()) {
        val b = al.getOrNull(a.index + 1)
        if (b != null && a.value + 1 == b) {
            bonus += cl[a.value - 1]
        }
    }
    print(sum + bonus)
}