program c1;
uses crt;
var a: array [1..5] of integer;
max,k,i: integer;
begin
clrscr;
for i:=1 to 5 do read (a[i]);
k:=0;
max:=1;
for i:=2 to 5 do
if a[i]>a[max] then max:=i;
for i:=1 to 5 do
if a[i]=a[max] then k:=k+1;
writeln ('Кол-во макс. элементов = ',k);
end.