import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; template BitOp(T) { bool bitTest(T n, size_t i) { return (n & (1.to!T << i)) != 0; } T bitSet(T n, size_t i) { return n | (1.to!T << i); } T bitReset(T n, size_t i) { return n & ~(1.to!T << i); } T bitComp(T n, size_t i) { return n ^ (1.to!T << i); } int bsf(T n) { return core.bitop.bsf(n.to!ulong); } int bsr(T n) { return core.bitop.bsr(n.to!ulong); } int popcnt(T n) { return core.bitop.popcnt(n.to!ulong); } } mixin BitOp!ulong; void main() { auto n = readln.chomp.to!size_t; auto ai = readln.split.map!(to!ulong).array; size_t i = 0; foreach (j; 0..61) { if (i >= n) break; auto k = ai[i..$].countUntil!(a => bitTest(a, j)); if (k == -1) continue; swap(ai[i], ai[k + i]); foreach (l; i + 1..n) { if (bitTest(ai[l], j)) ai[l] ^= ai[i]; } i += 1; } auto r = ai.count!(a => a != 0); writeln(2L ^^ r); }