import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); Bit bit = new Bit(); for (int i = 0; i < n; i++) { bit.shiftXOR(sc.nextInt()); } System.out.println(bit.getValue()); } static class Bit { static final int size = 1500000; static final long mask = (1 << 30) - 1; long[] arr; public Bit() { arr = new long[size]; arr[0] = 1; } public void shiftXOR(int val) { int div = val / 30; int mod = val % 30; for (int i = size - 1; i - div >= 0; i--) { long tmp = arr[i - div]; tmp <<= mod; if (i - div > 0) { tmp |= (arr[i - div - 1] << mod) >> 30; } arr[i] ^= tmp; } } public int getValue() { int value = 0; for (int i = 0; i < size; i++) { for (int j = 0; j < 30; j++) { if ((arr[i] & (1L << j)) != 0) { value ^= i * 30 + j; } } } return value; } } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }