-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU {-# LANGUAGE BangPatterns #-} import qualified Data.IntSet as S import Data.List import Data.Bits main = print . solve . map read . tail . words =<< getContents solve !a = S.size $ foldr f (S.singleton 0) $ nub a where f x !s = S.union s t where !t = S.map (xor x) s