#include <bits/stdc++.h>
using namespace std;
int a[100005], cst[100005], cdr[100005];
int main() {
  int n, i, maxim = 0, minim;
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (i = 1; i <= n; ++i) {
    minim = cst[i - 1] + 1;
    if (a[i] < minim) minim = a[i];
    cst[i] = minim;
  }
  for (i = n; i >= 1; --i) {
    minim = cdr[i + 1] + 1;
    if (minim > a[i]) minim = a[i];
    cdr[i] = minim;
  }
  for (i = 1; i <= n; ++i) {
    minim = cst[i];
    if (minim > cdr[i]) minim = cdr[i];
    if (maxim < minim) maxim = minim;
  }
  printf("%d", maxim);
  return 0;
}
