Var
arr : array [1..30] of integer;
sum, count, i, a : integer;
begin
read (a);
for i := 1 to 30 do read (arr[i]);
count := 0; sum := 0;
for i := 1 to 30 do
begin
if arr[i] < 0 then sum := sum + arr[i]
else if (arr[i] > 0) and (arr[i] <= a) then count := count + 1;<br> end;
writeln (sum, ' ', count);
end.
var
arr : array [1..30] of integer;
i : integer;
begin
for i := 1 to 30 do read (arr[i]);
for i := 30 downto 2 do
if arr[i] * arr[i - 1] < 0 then // проверка знака
begin
writeln (i - 1);
halt; // Остановка программы
end;
writeln ('-1'); // Таких нет
end.