using System; using System.Collections.Generic; using System.Linq; namespace Test01 { class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); string[] input = Console.ReadLine().Split(' '); int[] a = new int[N + 1]; for (int i = 1; i <= N; i++) a[i] = int.Parse(input[i - 1]); int max = 32767; bool[,] dp = new bool[N + 1, max + 1]; dp[0, 0] = true; for(int i = 1; i <= N; i++) { for(int j = max; j >= 0; j--) { dp[i, j] = dp[i - 1, j]; if ((j ^ a[i]) <= max) dp[i, (j ^ a[i])] |= dp[i, j]; } } int cnt = 0; for(int i = 0; i <= max; i++) { if (dp[N, i]) cnt++; } Console.WriteLine(cnt); } } }