using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var n = int.Parse(Console.ReadLine()); var a = Console.ReadLine().Trim().Split(' ').Select(value => int.Parse(value)).Distinct().ToArray(); var K = Combination.Generate(2, a.Length, true); var s = new List(); foreach(var k in K) { var z = 0; for(var i = 0; i < a.Length; i++) { if (k[i] == 1) { z ^= a[i]; } } s.Add(z); } Console.WriteLine(s.Distinct().Count()+1); } } static class Combination { private static List> _comb; public static List> Generate(int n, int r, bool dupulication) { _comb = new List>(); CalcCombination(new List(), n, r, dupulication); return _comb; } private static void CalcCombination(List list, int n, int r, bool dupulication) { if (list.Count == r) { _comb.Add(new List(list)); return; } var index = 0; if (dupulication) { index = list.Any() ? list.Last() : 0; } else { index = list.Any() ? list.Last() + 1 : 0; } for (int i = index; i < n; i++) { list.Add(i); CalcCombination(list, n, r, dupulication); list.Remove(i); } } } }