l,n=int(input()),int(input()) w=sorted(map(int,input().split())) t=x=0 while l>t and xl): break x+=1 print(x)