fun main(args:Array<String>){
    val typesOfFood = readLine()!!.toInt()
    val foodList = readLine()!!.split(" ").map(String::toInt)
    val happyLevel = readLine()!!.split(" ").map(String::toInt)
    val addHappyLevel = readLine()!!.split(" ").map(String::toInt).toMutableList()
    var ans = 0
//    println(foodList.size)
    for(i in 0..typesOfFood-1){
        ans += happyLevel[foodList[i]-1]
        if(i >= 1) {
            if (foodList[i] == foodList[i-1]+1) {
                ans += addHappyLevel[foodList[i]-1-1]  // 0-2
            }
        }
    }
    println(ans)
}