PROGRAM ATCODER

implicit none
integer :: n,t,i,dp,ans=0
integer,allocatable :: a(:),b(:)

read(*,*) n,t
allocate(a(n),b(n))
read(*,*) (a(i), i=1,n)

do i = 1,n
  b(i) = maxval(a(i:n)) - a(i)
end do

do i = 1,n
  if(b(i) == maxval(b))then
    ans = ans + 1
  end if
end do

write(*,'(i0)') ans

contains
!!!!!! サブルーチンは↓
!!!!!!

END PROGRAM ATCODER