#include <bits/stdc++.h>
using namespace std;
const int maxn = 20;
int a[maxn];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = n; i >= 1; i >>= 1) {
    for (int j = 0; j < n; j += i) {
      bool flag = true;
      for (int k = j; k < j + i - 1; k++) {
        flag &= (a[k] <= a[k + 1]);
      }
      if (flag) {
        printf("%d\n", i);
        return 0;
      }
    }
  }
}
