Var
a, n, i, sum, c, min: integer;
begin
sum := 0;
c := 0;
min := 10001;
read(n);
for i := 1 to n do
begin
read(a);
sum := sum + a;
c := c + 1;
if(a < min) and (a mod 4 <> 0) then min := a;
end;
if(sum mod 4 = 0) and (min <> 10001) then begin sum := sum - min; c := c - 1; end;
if(sum mod 4 = 0) then begin write(0); exit; end;
writeln(c, ' ', sum);
end.