#include #include #include #define repeat(i,n) for (int i = 0; (i) < int(n); ++(i)) #define repeat_reverse(i,n) for (int i = (n)-1; (i) >= 0; --(i)) #define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) using namespace std; uint64_t bit(int i) { return 1ull << i; } void add(vector & xs, uint64_t y) { for (uint64_t x : xs) { repeat_reverse (i,64) { if (not (x & bit(i)) and not (y & bit(i))) continue; if ((x & bit(i)) and (y & bit(i))) y ^= x; break; } } if (y) { xs.push_back(y); whole(sort, xs); whole(reverse, xs); } } int main() { int n; cin >> n; vector acc; repeat (i,n) { uint64_t a; cin >> a; add(acc, a); } cout << (1ll << acc.size()) << endl; return 0; }