Const n = 1; m = 1020;
var
b: array [1..n, 1..m] of real;
i, j, c: integer;
begin
randomize;
for i := 1 to n do
for j := 1 to m do
b[i, j] := Random(1001) - 500;
for i := 1 to n do
for j := 1 to m do begin
b[i, j] := (Sign(b[i, j]) + 1) shr 1;
c := c + Trunc(b[i, j]);
end;
writeln(c, ' единиц.');
end.