n = int(input())
a_input = input()
a = a_input.split(" ")
b_input = input()
b = b_input.split(" ")
c_input = input()
c = c_input.split(" ")

b_sum = 0
for i in range(n):
    b_sum += int(b[i])

c_sum = 0
for i in range(n-1):
    if int(a[i]) != n:
        c_sum += int(c[int(a[i])-1])
    else:
        c_sum += 0

sum = b_sum + c_sum
print(sum)