#include using namespace std; vector g[61 + 100000]; int match[61 + 100000]; bool used[61 + 100000]; void add_edge(int u, int v) { g[u].push_back(61 + v); g[61 + v].push_back(u); } bool dfs(int v) { used[v] = true; for (int i = 0; i < g[v].size(); i++) { int u = g[v][i]; int w = match[u]; if (w < 0 || !used[w] && dfs(w)) { match[v] = u; match[u] = v; return true; } } return false; } int bipartite_matching() { int ret = 0; memset(match, -1, sizeof(match)); for (int v = 0; v <= 60; v++) { if (match[v] < 0) { memset(used, 0, sizeof(used)); if (dfs(v)) { ++ret; } } } return ret; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector a(n); for (int i = 0; i < n; i++) cin >> a[i]; a.erase(unique(a.begin(), a.end()), a.end()); for (int i = 0; i < a.size(); i++) { for (int j = 0; j <= 60; j++) { if (a[i] & 1LL << j) add_edge(j, i); } } cout << (1LL<