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

point = 0
count = 0

for i, num in enumerate(a):
    point += b[num - 1]
    if i == (len(a) - 1):
        point += c[count]
        count += 1

print(point)


