n = int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
c.sort()
# s = 0
# j=0
# for i in range(n):
#   s+=b[a[i]-1]
#   # print(a[i])
#   try:
#     if (a[i+1]-a[i])==1 and (i)<(n-1):
#       s+=c[j]
#       j+=1
#         # print(c[j],a[i],a[i-1])
#   except:
#     pass
# print(s)
ss=sum(b)+sum(c)
print(ss)