#define _USE_MATH_DEFINES #include using namespace std; #define FOR(i,m,n) for(int i=(m);i<(n);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() using ll = long long; template using posteriority_queue = priority_queue, greater >; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fLL; const double EPS = 1e-8; const int MOD = 1000000007; // const int MOD = 998244353; const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1}; // const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx[] = {0, -1, -1, -1, 0, 1, 1, 1}; template inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; } template inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; } int popcount(int val) { return __builtin_popcount(val); } int popcountll(ll val) { return __builtin_popcountll(val); } template void unique(vector &a) { a.erase(unique(ALL(a)), a.end()); } struct IOSetup { IOSetup() { cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << fixed << setprecision(20); } } iosetup; const int COL = 61; struct BinaryMatrix { int m, n; BinaryMatrix(int m, int n = COL, bool def = false) : m(m), n(n), dat(m, bitset(0)) { if (def) { REP(i, m) REP(j, n) dat[i][j] = 1; } } BinaryMatrix pow(ll exponent) { BinaryMatrix tmp = *this, res(n, n); REP(i, n) res[i][i] = 1; while (exponent > 0) { if (exponent & 1) res *= tmp; tmp *= tmp; exponent >>= 1; } return res; } inline const bitset &operator[](const int idx) const { return dat[idx]; } inline bitset &operator[](const int idx) { return dat[idx]; } BinaryMatrix &operator=(const BinaryMatrix &rhs) { m = rhs.m; n = rhs.n; dat.resize(m); REP(i, m) dat[i] = rhs[i]; return *this; } BinaryMatrix &operator+=(const BinaryMatrix &rhs) { REP(i, m) dat[i] ^= rhs[i]; return *this; } BinaryMatrix &operator*=(const BinaryMatrix &rhs) { int height = m, width = rhs.n; BinaryMatrix t_rhs(rhs.n, rhs.m), res(height, width); REP(i, rhs.n) REP(j, rhs.m) t_rhs[i][j] = rhs[j][i]; REP(i, height) REP(j, width) res[i][j] = ((dat[i] & t_rhs[j]).count() & 1); *this = res; return *this; } BinaryMatrix operator+(const BinaryMatrix &rhs) const { return BinaryMatrix(*this) += rhs; } BinaryMatrix operator*(const BinaryMatrix &rhs) const { return BinaryMatrix(*this) *= rhs; } private: vector > dat; }; int gauss_jordan(BinaryMatrix &mat, bool is_extended = false) { int rank = 0; REP(col, mat.n) { if (is_extended && col == mat.n - 1) break; int pivot = -1; FOR(row, rank, mat.m) { if (mat[row][col]) { pivot = row; break; } } if (pivot == -1) continue; swap(mat[rank], mat[pivot]); REP(row, mat.m) { if (row != rank && mat[row][col]) mat[row] ^= mat[rank]; } ++rank; } return rank; } int main() { int n; cin >> n; BinaryMatrix mat(n); REP(i, n) { ll a; cin >> a; mat[i] = bitset(a); } int rank = gauss_jordan(mat); ll ans = 1; REP(_, rank) ans <<= 1; cout << ans << '\n'; return 0; }