using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; int switchCount = int.Parse(Reader.ReadLine()); this.SwitchList = Reader.ReadLine().Split(' ').Select(a=>int.Parse(a)).ToArray(); this.Dic = new bool[SwitchList.Length, (1<<14)]; this.GetAns(0, 0); Console.WriteLine(this.ans.Count); } private bool[,] Dic; private Dictionary ans = new Dictionary(); private void GetAns(int idx, int num) { if(idx == this.SwitchList.Length) { if(!ans.ContainsKey(num)) { ans.Add(num, true); } return; } if(this.Dic[idx, num]) { return; } this.GetAns(idx + 1, num); this.GetAns(idx + 1, num ^ SwitchList[idx]); this.Dic[idx, num] = true; } private int[] SwitchList; public class Reader { public static bool IsDebug = true; private static String PlainInput = @" 6 1 1 4 5 1 4 "; private static System.IO.StringReader Sr = null; public static string ReadLine() { if (IsDebug) { if (Sr == null) { Sr = new System.IO.StringReader(PlainInput.Trim()); } return Sr.ReadLine(); } else { return Console.ReadLine(); } } } static void Main() { Program prg = new Program(); prg.Proc(); } }