N = int(input())
A = [int(s) for s in input().split(' ')]
B = [int(s2) for s2 in input().split(' ')]
C = [int(s3) for s3 in input().split(' ')]

#satisfaction start value
satis = 0

#find two countinuously incremental numbers
for j in A[:]:
    for k in A[1:]:
        if j+1 == k:
            satis += C[j-1]

for i in A:
    satis += B[i-1]

print(satis)
