using System; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; namespace Solver { class Program { const int M = 1000000007; static void Main() { /* string textFile = @"C:\Users\Rikuto\Downloads\481-testcase\test_in\20_random_large01.in"; Encoding enc = Encoding.GetEncoding("shift_jis"); string[] lines = File.ReadAllLines(textFile, enc); int n = int.Parse(lines[0]); long[] a = lines[1].Trim().Split().Select(long.Parse).ToArray(); */ var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Scan sc = new Scan(); int n = sc.Int(); long[] a = sc.LongArray(); var set = new SortedSet(); foreach (long i in a) set.Add(i); while (true) { long pre = 0; var l = new SortedSet(); foreach (long i in set) { l.Add(Math.Min(i, pre ^ i)); pre = i; } if (set.Count == l.Count) break; set.Clear(); foreach (long i in l) set.Add(i); } sw.WriteLine((long)1 << set.Count); sw.Flush(); } } class Scan { public int Int() { return int.Parse(Console.ReadLine().Trim()); } public long Long() { return long.Parse(Console.ReadLine().Trim()); } public string Str() { return Console.ReadLine().Trim(); } public int[] IntArray() { return Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); } public void IntTwi(out int a, out int b) { int[] arr = IntArray(); a = arr[0]; b = arr[1]; } public void LongTwi(out long a, out long b) { long[] arr = LongArray(); a = arr[0]; b = arr[1]; } public void StrTwi(out string a, out string b) { string[] arr = StrArray(); a = arr[0]; b = arr[1]; } public long[] LongArray() { return Console.ReadLine().Trim().Split().Select(long.Parse).ToArray(); } public string[] StrArray() { return Console.ReadLine().Trim().Split(); } } }