package com.thinker.bishi.beiyou;

import java.util.Scanner;

/**
 * @author lzh
 * http://code.bupt.edu.cn/problem/p/84/
 */
public class SingleNumber {

    private static int result(int[] arr,int len){
        int check = 0;
        int chongfu = 0;
        // find chongfu
        for(int i=0;i<len;i++){
            int val = arr[i];
            if((check & (1<<val)) != 0){
                chongfu |= (1<<val);
            }
            check |= (1<<val);
        }
        chongfu = check & (~chongfu);
        return chongfu;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = Integer.parseInt(in.nextLine());
        String[] numStr = (in.nextLine()).split(" ");
        int[] nums = new int[num];
        for(int i=0;i<num;i++){
            nums[i] = Integer.parseInt(numStr[i]);
        }
        System.out.println(result(nums,num));

    }
}
