#include <bits/stdc++.h>
using namespace std;
int h[100005], l[100005], r[100005];
int n;
int main() {
  cin >> n;
  int i;
  for (i = 0; i < n; i++) cin >> h[i];
  memset(l, -1, sizeof l);
  memset(r, -1, sizeof r);
  l[0] = 0;
  r[n - 1] = 0;
  for (i = 1; i < n; i++) {
    if (l[i - 1] == -1)
      l[i] = 0;
    else
      l[i] = min(l[i - 1] + 1, h[i] - 1);
  }
  for (i = n - 2; i >= 0; i--) {
    if (r[i + 1] == -1)
      r[i] = 0;
    else
      r[i] = min(r[i + 1] + 1, h[i] - 1);
  }
  int maxi = 0;
  for (i = 0; i < n; i++) {
    maxi = max(maxi, min(l[i], r[i]));
  }
  cout << maxi + 1 << endl;
}
