import Data.List

count _ is [] = is
count p (i:is) (x:xs)
  | p == x = count x (i+1:is) xs
  | otherwise = count x (1:i:is) xs

main = do
  n <- readLn
  xs <- sort . map (map read . words) . lines <$> getContents
  let ds = [zipWith (-) (xs !! i) (xs !! j) | i <- [0..n-1], j <- [0..n-1], i > j]
  print . (n -) . max 1 . maximum $ count [] [0] (sort ds)
