#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int arr[16], n, m = 1;
void rec(int i, int j) {
  if (j - i == 1) return;
  if (is_sorted(arr + i, arr + j)) {
    m = max(m, j - i);
  } else {
    rec(i, i + (j - i) / 2);
    rec(i + (j - i) / 2, j);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  rec(0, n);
  cout << m;
}
