module main; // https://yukicoder.me/problems/no/183/editorial より // ナップザック問題 import std; void main() { // 入力 int N = readln.chomp.to!int; auto A = readln.split.to!(int[]); // 答えの計算 bool[int] dp; dp[0] = true; foreach (a; A) { auto newDP = dp.dup; foreach (k; dp.keys) { newDP[a ^ k] = true; } dp = newDP; } // 答えの出力 writeln(dp.length); }