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