begin
var a := MatrRandom(5, 5, 0, 2);
a.Println;
var Max := integer.MinValue;
var Count := 0;
for var i := 0 to 4 do
for var j := 0 to 4 do
if i + j > 4 then
begin
if Max < a[i, j] then
begin
Max := a[i, j];
Count := 1
end
else
if Max = a[i,j] then
Count += 1
end;
Write(Count)
end.