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[max + 1]; dp[0] = true; for(int i = 1; i <= N; i++) { for(int j = 0; j <= max; j++) { if ((j ^ a[i]) <= max) dp[j ^ a[i]] |= dp[j]; } } int cnt = 0; for(int j = 0; j <= max; j++) { if (dp[j]) cnt++; } Console.WriteLine(cnt); } } }