import java.io.*; import java.util.*; class Main { public static void main(String args[])throws Exception { BufferedReader bu=new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb=new StringBuilder(); int n=Integer.parseInt(bu.readLine()); String s[]=bu.readLine().split(" "); int i,c[]=new int[63],j; long a; for(i=0;i>j)&1)==1) c[j]++; } long ans=0; for(i=0;i<63;i++) if(c[i]==0) { ans=1l<