import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            int[] nodes = new int[3];
            for (int i = 0; i < n; ++i) {
                nodes[i] = in.nextInt();
            }
            Arrays.sort(nodes);
            System.out.println(commonRoot(1 << (n - 1), nodes));
        }
    }

    private static int commonRoot(int root, int[] nodes) {
        if (nodes[0] == root || nodes[2] == root) {
            return root;
        }
        if (nodes[0] > root) {
            return commonRoot(root + root >> 1, nodes);
        } 
        if (nodes[2] < root) {
            return commonRoot(root >> 1, nodes);
        } else {
            return root;
        }
    }

}