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