local ffi = require("ffi") local C = ffi.C ffi.cdef[[ long long atoll(const char*); ]] local function lltonumber(str) return C.atoll(str) end local n = io.read("*n", "*l") local str = io.read() local a = {} for w in str:gmatch("%d+") do table.insert(a, lltonumber(w)) end local ret = 1LL local t = {} for i = 1, n do t[i] = {} local ai = a[i] for j = 1, 60 do t[i][j] = ai % 2LL == 1LL ai = ai / 2LL end end for j = 1, 60 do for i = 1, n do if t[i][j] then ret = ret + ret for k = i + 1, n do for l = j, 60 do if t[i][l] then t[k][l] = not t[k][l] end end end for k = j, 60 do t[i][k] = false end break end end end ret = tostring(ret):gsub("LL", "") print(ret)