program dz3;
Const x=5;
y=8;
Type Tmas=array [1..x,1..y] of integer;
Var n,m,min,max:integer;
Mas:tmas;
procedure MaxValue(const a: Tmas; var max:integer);
var
n,m,max_: integer;
begin
Max_:=a[1,1];
for n:=1 to x do
for m:=1 to y do
if a[n,m] > Max_ then Max_:=a[n,m];
max:=max_;
end;
procedure MinValue(const a: Tmas; var min:integer);
var
n,m, min_: integer;
begin
min_:=a[1,1];
for n:=1 to x do
for m:=1 to y do
if a[n,m] < Min_ then Min_:=a[n,m];
min:=min_;
end;
Function o_elm (a:tmas) :integer;
Var n,m,k:integer;
begin
k:=0;
for n:=1 to x do
for m:=1 to y do
If a[n,m]=0 then k:=k+1;
o_elm:=k;
End;
begin
writeln('enter mass');
for n:=1 to x do
For m:=1 to y do
readln(mas[n,m]);
maxValue(mas,max);
minValue(mas,min);
Writeln('max = ',max);
Writeln('min = ',min);
Writeln('kolvo 0 = ',o_elm(mas));
readln;
End.