program zht;
var
a:array[1..1000000] of longint;
n,i,temp,zs:longint;
v:real;
procedure qsort(s,t:longint);
var
i,j,x:longint;
begin
i:=s;j:=t;x:=a[(i+j)div 2];
repeat
while a[i]<x do inc(i);
while a[j]>x do dec(j);
if i<=j then
begin
temp:=a[i];a[i]:=a[j];a[j]:=temp;
inc(i);dec(j);
end;
until i>j;
if s<j then qsort(s,j);
if i<t then qsort(i,t);
end;
begin
assign(input,'jiahao1.in');
assign(output,'jiahao1.out');
reset(input);
rewrite(output);
readln(v,n);
for i:=1 to n do
read(a[i]);
qsort(1,n);
for i:=1 to n do
if v>a[i] then begin zs:=zs+1;v:=v+(a[i]/2);end else break;
writeln(zs);
close(input);
close(output);
end.