using System; public class Hello { static void Main() { var n = int.Parse(Console.ReadLine().Trim()); string[] line = Console.ReadLine().Trim().Split(' '); var a = Array.ConvertAll(line, long.Parse); getAns(n, a); } static void getAns(int n, long[] a) { long x; if (n == 1) x = a[0]; else { x = a[0] | a[1]; for (int i = 2; i < n; i++) x |= a[i]; } var onf = new bool[60]; for (int i = 0; i < 60; i++) { if (((x >> i) & 1) == 1) onf[i] = true; } var ans = -1L; for (int i = 0; i < 60; i++) { if (!onf[i]) { ans = 1L << i; break; } } if (ans == -1) ans = 1 << 60; Console.WriteLine(ans); } }