#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int a[n + 5];
    for (int i = 0; i < n; i++) cin >> a[i];
    int len = 1, ans;
    while (len <= n) {
      int f = 0;
      for (int i = 0; i < n; i += len) {
        f = 0;
        for (int j = i + 1; j < min(n, i + len); j++) {
          if (a[j] < a[j - 1]) {
            f = 1;
            break;
          }
        }
        if (!f) {
          ans = len;
          break;
        }
      }
      len *= 2;
    }
    cout << ans << endl;
  }
  return 0;
}
