n, m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) res = 0 for x in a: if b[x-1] > 0: b[x-1] -= 1 else: res += 1 print(res)