import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    n <- getInt
    xys <- replicateM n $ do
        [x,y] <- getIntList
        return (x,y)
    let ps = replicateM 2 xys
    print . (n -) . (\xs -> if null xs then 0 else maximum xs) . map length . group . sort . filter (/= (0,0)) $ map (\((x1,y1):(x2,y2):_) -> (x1-x2, y1-y2)) ps