a = int(input())

s = [input().split() for i in range(3)]

count =  0

num = s[0]
point = s[1]
bonus = s[2]


for p in range(int(len((num)))):
    count += int(point[int(num[p])-1])

for q in range(int(len(num))-1):
    if int(num[q+1]) - int(num[q]) == 1:
        count += int(bonus[q-1])
    
print(count)