n = int(input())
foods = list(map(int,input().split()))
satis_1 = list(map(int,input().split()))
satis_2 = list(map(int,input().split()))
ttl = 0

for i in range(n):
  food = foods[i]
  ttl += satis_1[food-1]
  if(i > 0 and i<n-1):
    ttl += satis_2[food-1]
print(ttl)