(* Enter your code here. Read input from STDIN. Print output to STDOUT *) //birthdaycakes const fi=''; fo=''; var f:text; n,i,max,res,v:longint; a:array[1..100000]of longint; begin max:=0;res:=0; assign(f,fi); reset(f); readln(f,n); for i:=1 to n do begin read(f,a[i]); if a[i]>max then max:=a[i]; end; close(f); for i:=1 to n do begin if a[i]=max then inc(res); end; assign(f,fo); rewrite(f); writeln(f,res); close(f); end.