n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
c.append(0)
p = 0
ans = 0
for i in range(n):
    ans += b[a[i]-1]
    ans += p
    p = c[a[i]-1]
print(ans)
