import Data.List
main = getLine >> getLine >>= print . solve . map read . words
    where
        solve = (\(_, y, _) -> y) . foldr ff (0, 0, 0)
            where
                ff z (v, n, x)
                    | z > x = (v, n, z)
                    | v < d = (d, 1, x)
                    | v == d = (v, n + 1, x)
                    | otherwise = (v, n, x)
                    where
                        d = x - z
