#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i)) #define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i)) #if defined(_MSC_VER) || __cplusplus > 199711L #define aut(r,v) auto r = (v) #else #define aut(r,v) __typeof(v) r = (v) #endif #define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it) #define all(o) (o).begin(), (o).end() #define pb(x) push_back(x) #define mp(x,y) make_pair((x),(y)) #define mset(m,v) memset(m,v,sizeof(m)) #define INF 0x3f3f3f3f #define INFL 0x3f3f3f3f3f3f3f3fLL using namespace std; typedef vector vi; typedef pair pii; typedef vector > vpii; typedef long long ll; template inline void amin(T &x, U y) { if(y < x) x = y; } template inline void amax(T &x, U y) { if(x < y) x = y; } typedef unsigned long long Val; vector gaussianEliminationMod2(vector v, int B) { int n = v.size(); vector t(B, 0); int used = 0; for(int j = B-1; j >= 0; j --) { int i = used; while(i < n && (~v[i] >> j & 1)) i ++; if(i < n) { Val x = v[i]; swap(v[i], v[used ++]); t[j] = x; for(i = used; i < n; i ++) if(v[i] >> j & 1) v[i] ^= x; } } return t; } int main() { int N; scanf("%d", &N); vector A(N); rep(i, N) scanf("%llu", &A[i]); vector basis = gaussianEliminationMod2(A, 62); Val ans = 1ULL << (basis.size() - count(all(basis), 0)); printf("%llu\n", ans); return 0; }