from collections import Counter n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) dict = Counter(a) r = [0] * m for k, v in dict.items(): r[k-1] = v ans = 0 for i in range(m): c = r[i] - b[i] if c > 0: ans += c print(ans)