#include using namespace std; using Int = unsigned long long; int main() { Int N; cin >> N; Int A[N]; for (Int i = 0; i < N; i++) cin >> A[i]; for (Int i = 0; i < N; i++) { Int min_bit = 100; Int min_index = 0; for (Int j = i; j < N; j++) { for (Int k = 0; k < 64; k++) { if (A[j] & ((Int)1 << k)) { if (k < min_bit) { min_index = j; min_bit = k; } } } } if (min_bit == 100) break; swap(A[i], A[min_index]); for (Int j = i + 1; j < N; j++) { if (A[j] & ((Int)1 << min_bit)) { A[j] ^= A[i]; } } } Int ans = 0; for (Int i = 0; i < N; i++) { bool flag = false; for (Int j = 0; j < 64; j++) { flag |= (A[i] & ((Int)1 << j)); } ans += flag; } cout << ((Int)1 << ans) << endl; }