"use strict"
 
const arg_str = require('fs').readFileSync('/dev/stdin', 'UTF-8')
const args_lines = arg_str.split('\n')
const N = args_lines[0]
const a = args_lines[1]
const a_s = a.split(' ')
const b = args_lines[2]
const b_s = b.split(' ')
const c = args_lines[3]
const c_s = c.split(' ')
 
let sum = 0
let last_val = 0
 
a_s.map(x=>{
    if(!b_s[x-1]) return
    sum += parseInt(b_s[x-1])
    if(x - 1 == last_val + 1){
        if(c_s.length > 0 && c_s[last_val]){
            sum += parseInt(c_s[last_val])
        }else{
          if(last_val == 0){
            sum += parseInt(c_s)
          }
        }
    }
    last_val = x - 1
})
 
console.log(sum)