local mfl, mce = math.floor, math.ceil local n = io.read("*n") local a = {} for i = 1, n do a[i] = io.read("*n") end local ans = 0LL local mul = 1LL local tot = mfl(n * (n + 1) / 2) for i = 0, 27 do local len = 0 local z = tot for j = 1, n do if a[j] % 2 == 0 then len = len + 1 else len = 0 end a[j] = mfl(a[j] / 2) z = z - len end ans = ans + mul * z mul = mul * 2LL end ans = tostring(ans):gsub("LL", "") print(ans)