(n,m),a,b=[[*map(int,s.split())]for s in open(0)] d=[0]*m for i in a: d[i-1]+=1 ans=0 for i,j in zip(d,b): ans+=max(0,i-j) print(ans)