#include <bits/stdc++.h>
using namespace std;
int n, i, j, k, flag, Ans;
int a[110];
inline int Abs(int x) { return (x < 0) ? x : -x; }
inline int Min(int a, int b) { return (a < b) ? a : b; }
inline int Max(int a, int b) { return (a > b) ? a : b; }
inline int read() {
  int p = 0;
  char c = getchar();
  while (c < 48 || c > 57) c = getchar();
  while (c >= 48 && c <= 57) p = (p << 1) + (p << 3) + c - 48, c = getchar();
  return p;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  Ans = 1;
  if (n == 1) {
    cout << "1" << endl;
    return 0;
  }
  for (i = 2; i <= 16; i *= 2) {
    for (j = 1; j <= n; j += i) {
      flag = 0;
      for (k = j + 1; k <= j + i - 1; k++)
        if (a[k] < a[k - 1]) {
          flag = 1;
          break;
        }
      if (flag == 0) Ans = i;
    }
  }
  printf("%d\n", Ans);
  return 0;
}
