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 in range(n):
  ai = a[i]
  ans += b[ai - 1]
  if ai < len(c) and i != n - 1:
    ans += c[ai - 1]

print(ans)