#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int h[MAXN];
int lans[MAXN];
int rans[MAXN];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &h[i]);
  lans[1] = 1;
  for (int i = 2; i <= n - 1; i++) {
    if (h[i] >= 2 && h[i - 1] >= 1 && h[i + 1] >= 1) {
      lans[i] = min(lans[i - 1] + 1, h[i]);
    } else {
      lans[i] = 1;
    }
  }
  rans[n] = 1;
  for (int i = n - 1; i >= 2; i--) {
    if (h[i] >= 2 && h[i - 1] >= 1 && h[i + 1] >= 1) {
      rans[i] = min(rans[i + 1] + 1, h[i]);
    } else {
      rans[i] = 1;
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, min(lans[i], rans[i]));
  }
  if (n <= 2) ans = 1;
  cout << ans << endl;
  return 0;
}
