#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int n;
int h[MAXN];
int ldp[MAXN];
int rdp[MAXN];
int main() {
  cin >> n;
  for (int ii = 1; ii <= n; ii++) {
    cin >> h[ii];
  }
  int ans = -1;
  for (int ii = 1; ii <= n; ii++) {
    ldp[ii] = min(h[ii], ldp[ii - 1] + 1);
  }
  for (int ii = n; ii >= 1; ii--) {
    rdp[ii] = min(h[ii], rdp[ii + 1] + 1);
  }
  for (int ii = 1; ii <= n; ii++) {
    ans = max(ans, min(ldp[ii], rdp[ii]));
  }
  cout << ans;
}
