R=range J=lambda:list(map(int,input().split())) N,M=J() A=J() B=J() C=[0]*M for a in A:C[a-1]+=1 print(sum(max(0,C[j]-B[j])for j in R(M)))