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 t = {} for i = 1, 63 do t[i] = false end local s = io.read() for w in s:gmatch("%d+") do local num = lltonumber(w) for j = 1, 63 do if num % 2LL == 1LL then t[j] = true end num = num / 2LL end end local ret = 1LL for i = 1, 63 do if not t[i] then ret = tostring(ret):gsub("LL", "") print(ret) os.exit() end ret = ret * 2LL end