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

readInt' = fst.fromJust.C.readInt
readLnInt = map readInt'.C.words<$>C.getLine
readCsInt n = concat<$>replicateM n readLnInt

x ? (a,b) = if x then a else b

main = do
 [n] <- readLnInt
 inputs <- readCsInt n
 print $ solve inputs

solve s@(a:b:x) = 1 + (null x)?(0,sum (nubx s))

nubx s = tail $ reverse $ sort $ map length $ group $ sort (distance s)
distance (a:b:[]) = []
distance (a:b:c:d:e)= [(c-a,d-b)] ++ distance (c:d:e)
