# a.py
# N = int(input()) #ここで標準入力
# # print (type(N),N) 

# print(N*N*N)
#### ##################
# b.py
man=0

N = int(input()) #ここで標準入力
A = [input().split() for i in range(3)]

# print(A)
# B全部たす
for i in range(N):
   man=man+int(A[1][i])
#例外処理
for i in range(N-1):
   if(A[0][i]<A[0][i+1]):
      # print(man)
      cn=int(A[0][i])
      man=man+int(A[2][cn-1])
      # print (cn)


print(man)