import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); long[] inputs = new long[N]; for(int i = 0; i < N; i++){ inputs[i] = -sc.nextLong(); } Arrays.sort(inputs); for(int i = 0; i < N; i++){ inputs[i] = -inputs[i]; } /* for(int i = 0; i < N; i++){ String str = Long.toBinaryString(inputs[i]); for(int j = 0; j < 64 - str.length(); j++){ System.out.print("0"); } System.out.println(str); } System.out.println("--------------------------------------------"); */ int rank = N; for(int cur_index = 0; cur_index < N; cur_index++){ final int cur_keta = Long.numberOfTrailingZeros(Long.highestOneBit(inputs[cur_index])); if(inputs[cur_index] == 0){ rank--; } for(int next_index = cur_index + 1; next_index < N; next_index++){ final int next_keta = Long.numberOfTrailingZeros(Long.highestOneBit(inputs[next_index])); if(cur_keta == next_keta){ inputs[next_index] ^= inputs[cur_index]; } } } /* for(int i = 0; i < N; i++){ String str = Long.toBinaryString(inputs[i]); for(int j = 0; j < 64 - str.length(); j++){ System.out.print("0"); } System.out.println(str); } */ System.out.println(1l << rank); } }