#include <bits/stdc++.h>
int h[100004], n, kleft[100004], kright[100004];
int zmin(int x1, int x2) { return (x1 <= x2) ? x1 : x2; }
int main(void) {
  int i, res = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) scanf("%d", &h[i]);
  for (i = 1; i <= n; ++i) {
    kleft[i] = zmin(h[i], kleft[i - 1] + 1);
    kright[n - i + 1] = zmin(h[n - i + 1], kright[n - i + 2] + 1);
  }
  for (i = 1; i <= n; ++i) {
    int k = zmin(kleft[i], kright[i]);
    if (res == 0 || k > res) res = k;
  }
  printf("%d\n", res);
  return 0;
}
