local ior = io.read local n = ior("*n") local t = {} local function getxor(x, y) local ret = 0 local mul = 1 while(0 < x or 0 < y) do if((x % 2) + (y % 2) == 1) then ret = ret + mul end x, y, mul = math.floor(x / 2), math.floor(y / 2), mul * 2 end return ret end for i = 1, n do local a = ior("*n") if(t[a] == nil) then local tmp = {} for k, v in pairs(t) do table.insert(tmp, getxor(k, a)) end for j = 1, #tmp do t[tmp[j]] = true end t[a] = true end end local cnt = 0 for k, v in pairs(t) do cnt = cnt + 1 end print(cnt + 1)