#include <bits/stdc++.h>
using namespace std;
int n;
int b[100005];
int ltr[100005];
int rtl[100005];
int main() {
  cin >> n;
  for (int q = 1; q <= n; q++) {
    cin >> b[q];
    ltr[q] = min(b[q], ltr[q - 1] + 1);
  }
  for (int q = n; q > 0; q--) {
    rtl[q] = min(b[q], rtl[q + 1] + 1);
  }
  int mx = 0;
  for (int q = 1; q <= n; q++) {
    mx = max(mx, min(ltr[q], rtl[q]));
  }
  cout << mx;
  return 0;
}
