import Data.List

solve' m xs xss = if null xs
	then xss
	else solve' (min (head xs) m) (tail xs) (xss ++ [(head xs) - m])

solve (x1:xs:_) = length . last . group . sort $ solve' (head xs) (tail xs) []

main = print . solve . map (map read) . map words . lines =<< getContents