import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; import java.util.PriorityQueue; import java.util.Scanner; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); PriorityQueue queue = new PriorityQueue(N, Collections.reverseOrder()); for(int i = 0; i < N; i++){ queue.add(sc.nextLong()); } while(!queue.isEmpty()){ final long value = queue.poll(); if(value == 0){ queue.add(value); break; }else{ final long min = Long.highestOneBit(value); while(!queue.isEmpty()){ final long next_value = queue.poll(); if((next_value & min) != 0){ queue.add(next_value ^ value); }else{ queue.add(next_value); break; } } } } final int rank = N - queue.size(); System.out.println(1l << rank); } public static class Scanner { private BufferedReader br; private StringTokenizer tok; public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is)); } private void getLine() throws IOException { while (!hasNext()) { tok = new StringTokenizer(br.readLine()); } } private boolean hasNext() { return tok != null && tok.hasMoreTokens(); } public String next() throws IOException { getLine(); return tok.nextToken(); } public int nextInt() throws IOException { return Integer.parseInt(next()); } public long nextLong() throws IOException { return Long.parseLong(next()); } public void close() throws IOException { br.close(); } } }