#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int MAX_ROW = 5050; const int MAX_COL = 15; struct BitMatrix { int H,W; bitset< MAX_COL > val[MAX_ROW]; BitMatrix(int m = 1, int n = 1) : H(m), W(n) {} inline bitset< MAX_COL > & operator[] (int i) { return val[i]; } }; int Gauss_Jordan(BitMatrix &A, bool is_extended = false) { int rank = 0; for(int col = 0; col < A.W; ++col) { if(is_extended && col == A.W - 1) break; int pivot = -1; for(int row = rank; row < A.H; ++row) { if(A[row][col]) { pivot = row; break; } } if(pivot == -1) continue; swap(A[pivot], A[rank]); for(int row = 0; row < A.H; ++row) { if(row != rank && A[row][col]) A[row] ^= A[rank]; } ++rank; } return rank; } int main(){ cin.tie(0); ios::sync_with_stdio(0); int N; cin >> N; BitMatrix A(N, 15); rep(i,N) { int a; cin >> a; rep(j,15) A[i][j] = (a & (1 << j)); } int rank = Gauss_Jordan(A); cout << (1LL << rank) << endl; }