n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ans = 0
for i, dish in enumerate(a):
    ans += b[dish-1]
    if dish-1 != n-1 and i != n-1:
        ans += c[dish-1]

print(ans)