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