f=lambda:map(int,input().split()) N,K=f() p=[0]*401 for n in f(): p[n]+=1 m=0 for n in p[::-1]: if m+n>K:break m+=n print(m)