program ex;
var
m,n,i,j,zhen,jia,min,max:longint;
a:array[1..50000] of longint;
begin
assign(input,'criminala.in');
assign(output,'criminala.out');
reset(input);
rewrite(output);
readln(n,m);
for i:=1 to m do readln(a[i]);
max:=0;min:=maxlongint;
for i:=1 to n do
begin
for j:=1 to m do
begin
if (a[j]>0) then
if (i=a[j]) then inc(zhen) else inc(jia);
if (a[j]<0) then
if (i=abs(a[j])) then inc(jia) else inc(zhen);
end;
if jia>max then max:=zhen;
if jia<min then min:=jia;
zhen:=0;
jia:=0;
end;
writeln(max);
writeln(min);
close(input);
close(output);
end.