#include <bits/stdc++.h>
using namespace std;
int lef[100005], rig[100005], a[100005];
int n;
int main(void) {
  int i, j;
  while (~scanf("%d", &n)) {
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    lef[0] = 1;
    rig[n - 1] = 1;
    for (i = 1; i < n; i++) {
      lef[i] = min(a[i], lef[i - 1] + 1);
    }
    for (i = n - 2; i > 0; i--) {
      rig[i] = min(rig[i + 1] + 1, a[i]);
    }
    int ans = 0;
    for (i = 0; i < n; i++) ans = max(ans, min(rig[i], lef[i]));
    printf("%d\n", ans);
  }
  return 0;
}
