NT=eval(input())

NT=NT.rstrip().split(" ")

N=int(NT[0])

T=int(NT[1])



cnt=0

sa=0

min=0

max=0



L=eval(input())

L=L.rstrip().split(" ")

min=int(L[0])

for i in range(1,len(L)):

    if int(L[i])<min:

        min=int(L[i])

    s=int(L[i])-min

    if s>sa:

        sa=s

        cnt=1

    elif s==sa:

        cnt+=1

    

    #print(cnt,sa,max,min)

print(cnt)

        

    
N,T=list(map(int,input().split()))

listA=list(map(int,input().split()))

max=-1

count=0

min=listA[0]

for i in range(N-1):

    if listA[1+i]<min:

        min=listA[1+i]

    if listA[1+i]-min>max:

        max=listA[1+i]-min

        count=1

    elif listA[1+i]-min==max:

        count+=1

print(count)
NT = eval(input())
NT = NT.rstrip().split(" ")
N = int(NT[0])
T = int(NT[1])
cnt = 0
sa = 0
min = 0
max = 0
L = eval(input())
L = L.rstrip().split(" ")
min = int(L[0])
for i in range(1, len(L)):
    if int(L[i]) < min:
        min = int(L[i])
    s = int(L[i]) - min
    if s > sa:
        sa = s
        cnt = 1
    elif s == sa:
        cnt += 1
    # print(cnt,sa,max,min)
print(cnt)

N, T = list(map(int, input().split()))
listA = list(map(int, input().split()))
max = -1
count = 0
min = listA[0]
for i in range(N - 1):
    if listA[1 + i] < min:
        min = listA[1 + i]
    if listA[1 + i] - min > max:
        max = listA[1 + i] - min
        count = 1
    elif listA[1 + i] - min == max:
        count += 1
print(count)

-NT = eval(input()) -NT = NT.rstrip().split(" ") -N = int(NT[0]) -T = int(NT[1]) -cnt = 0 -sa = 0 -min = 0 -max = 0 -L = eval(input()) -L = L.rstrip().split(" ") -min = int(L[0]) -for i in range(1, len(L)): -    if int(L[i]) < min: -        min = int(L[i]) -    s = int(L[i]) - min -    if s > sa: -        sa = s -        cnt = 1 -    elif s == sa: -        cnt += 1 -    # print(cnt,sa,max,min) -print(cnt) +N, T = list(map(int, input().split())) +listA = list(map(int, input().split())) +max = -1 +count = 0 +min = listA[0] +for i in range(N - 1): +    if listA[1 + i] < min: +        min = listA[1 + i] +    if listA[1 + i] - min > max: +        max = listA[1 + i] - min +        count = 1 +    elif listA[1 + i] - min == max: +        count += 1 +print(count)