#include <bits/stdc++.h>
using namespace std;
int n;
int A[100];
bool ifsort(int l, int r) {
  bool ans = true;
  for (int i = l + 1; i < r; i++) {
    if (A[i] < A[i - 1]) {
      ans = false;
      break;
    }
  }
  return ans;
}
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int d = n; d >= 2; d /= 2) {
    for (int i = 0; (i + d) <= n; i += d)
      if (ifsort(i, i + d)) {
        cout << d << "\n";
        return 0;
      }
  }
  cout << "1\n";
  return 0;
}
