main :: IO()
main = do
    getLine
    ls <- map read . words <$> getLine
    print $ getsolve (tail ls) (head ls) 0 0

getsolve :: [Integer] -> Integer -> Integer -> Int -> Int
-- 値段リスト　→　これまでの最小値　→　差額マックス　→　差額マックス回数　→　回答（差額マックス回数）
getsolve [] _ _ count = count
getsolve ls minval defmax count
    | nextval < minval					= getsolve (tail ls) nextval defmax count
    | nextdefmax > defmax				= getsolve (tail ls) minval nextdefmax 1
    | nextdefmax == defmax				= getsolve (tail ls) minval defmax (count + 1)
    | otherwise							= getsolve (tail ls) minval defmax count
    where nextval = head ls
          nextdefmax = nextval - minval

