N = int(input())

A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

d = dict(zip(A, B))
ans = d[A[0]]

for i in range(1, N):
    if d[A[i]] - d[A[i-1]] > 0:
        ans += d[A[i]] + C[i-1]
    else:
        ans += d[A[i]]

print(ans)