m,n = map(int,input().split()) 

tez = list(map(int,input().split()))
val = list(map(int,input().split()))
cap = list(map(int,input().split()))

obj = []
rez = 0

for i in range(m):
    obj.append((val[i],tez[i]))

obj.sort()
cap.sort()

p=0

for i in range(m):
    if len(cap)==0:
        break
    if obj[i][1]<cap[0] :
        l = 0
        d = len(cap);  
        while (l != d):
            s = (l + d) // 2;
            if cap[s] <= obj[i][1]:
                l = s + 1;
            else:
                d = s;
        rez += obj[i][0]
        del cap[d]
    

print(rez)