main = getLine >> getLine >>= (\(_, y, _) -> print y) . foldr (ff . read) (0, 0, 0) . words
    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
