program criminala;
var
a:array [1..50000] of longint;
h1,h2:array [1..1000] of longint;
n,m,max,min:longint;
f1,f2:text;
procedure init;
var i:longint;
begin
assign(f1,'criminala.in'); reset(f1);
assign(f2,'criminala.out'); rewrite(f2);
readln(f1,n,m);
for i:=1 to m do begin
readln(f1,a[i]);
if a[i]>0 then inc(h1[a[i]])
else inc(h2[abs(a[i])]);
end;
close(f1);
max:=0;
min:=0;
end;
procedure play;
var i:longint;
begin
for i:=1 to n do
if h1[i]>h2[i] then begin max:=max+h1[i]; min:=min+h2[i]; end
else begin max:=max+h2[i]; min:=min+h1[i]; end;
end;
begin
init;
play;
writeln(f2,max);
writeln(f2,min);
close(f2);
end.