import Data.List
import Data.Ord
main = do
    [n,t] <- input <$> getLine
    a <- input <$> getContents 
    putStrLn $ show [n,t]
    putStrLn $ show $ answer a

input :: String -> [Int]
input = map read . words

answer :: [Int] -> Int
answer (c:cities) = let (_,_,cost) = foldl foldfunc (c,0,0) cities in cost

foldfunc (smallest,maxbene,cost) a
    | a - smallest >  maxbene = (min smallest a, a - smallest, 1)
    | a - smallest == maxbene = (min smallest a, maxbene, cost+1)
    | a - smallest <  maxbene = (min smallest a, maxbene, cost)
