#include <bits/stdc++.h>
using namespace std;
int n, t[100000];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> t[i];
  for (int i = n; i > 0; i /= 2)
    for (int j = 0; j < n; j += i)
      if (is_sorted(t + j, t + j + i)) {
        cout << i;
        return 0;
      }
}
