import math

def binary_search(boxes, weight):
    start = 0
    end = len(boxes) - 1

    while start <= end:
        middle = start + math.ceil((end - start) / 2);

        if boxes[middle] == weight:
            return middle
        elif boxes[middle] < weight:
            start = middle + 1
        else:
            end = middle - 1

    if boxes[-1] < weight:
        return None
    elif middle and boxes[middle - 1] > weight:
        return middle - 1
    elif boxes[middle] > weight:
        return middle
    elif boxes[middle - 1] > weight:
        return middle - 1
    return middle + 1

M, N = map(int, input().split())
T = list(map(int, input().split()))
V = list(map(int, input().split()))
C = sorted(list(map(int, input().split())))

value = 0

VT = sorted(zip(V, T), reverse=True)

for pair in VT:
    position = binary_search(C, pair[1])

    if position != None:
        value += pair[0]

        del C[position]
        if not C:
            break

print(value, end="")