program wz;
var
a:array[0..1000001]of longint;
i,n,ans:longint;
m:real;
procedure sort(x,y:longint);
var
i,j,mid,k:longint;
begin
i:=x;
j:=y;
mid:=a[(i+j)div 2];
repeat
while a[i]<mid do inc(i);
while a[j]>mid do dec(j);
if i<=j then
begin
k:=a[i];
a[i]:=a[j];
a[j]:=k;
inc(i);
dec(j);
end;
until i>j;
if x<j then sort(x,j);
if i<y then sort(i,y);
end;
begin
assign(input,'jiahao1.in');
assign(output,'jiahao1.out');
reset(input);
rewrite(output);
fillchar(a,sizeof(a),0);
readln(m,n);
ans:=0;
for i:=1 to n do
readln(a[i]);
sort(1,n);
for i:=1 to n do
if m>a[i] then
begin
inc(ans);
m:=m+(a[i] / 2);
end
else break;
writeln(ans);
close(input);
close(output);
end.