// Arup Guha
// 3/5/2022
// Solution to 2021 SER D1 Problem: XOR Island

import java.util.*;

public class xorisland {

	public static int n;
	public static int[] vals;
	
	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		n = stdin.nextInt();
		vals = new int[n];
		
		// Get the n numbers.
		for (int i=0; i<n; i++)
			vals[i] = stdin.nextInt();
			
		// dp[mask] stores false if NO subset of 3 inside mask XORs to 0.
		boolean[] dp = new boolean[1<<n];
		
		// Biggest set that doesn't work.
		int size = 2;
		
		// Go through all masks.
		for (int mask=7; mask<(1<<n); mask++) {
		
			// Skip these.
			int bits = Integer.bitCount(mask);
			if (bits < 3) continue;
			
			// Special case - just do this subset.
			if (bits == 3) {
			
				int xor = 0;
				for (int i=0; i<n; i++)
					if ((mask & (1<<i)) != 0)
						xor ^= vals[i];
				dp[mask] = (xor == 0);
				continue;
			}
			
			// We haven't found a subset of 3 that works yet inside of mask.
			dp[mask] = false;
			
			// See if any of mask's direct subsets have a subset of 3 that works. If not, then none of mask's
			// subsets work.
			for (int i=0; i<n; i++) {
				if ((mask & (1<<i)) != 0) {
					int prev = mask - (1<<i);
					if (dp[prev]) {
						dp[mask] = true;
						break;
					}
				}
			}
			
			// Update. We want the largest set for which there is no subset of size 3 that works.
			if (!dp[mask]) size = Math.max(size, bits);
		}
		
		// Answer is n minus the largest size that doesn't work.
		System.out.println(n-size);
	}
}