#include <bits/stdc++.h>
using namespace std;
int h[100010];
int l[100010];
int r[100010];
int main() {
  int i, j, n;
  while (scanf("%d", &n) != EOF) {
    int max = -1;
    for (i = 1; i <= n; i++) scanf("%d", &h[i]);
    l[1] = 1;
    for (i = 2; i <= n; i++) l[i] = min(l[i - 1] + 1, h[i]);
    r[n] = 1;
    for (i = n - 1; i >= 1; i--) r[i] = min(r[i + 1] + 1, h[i]);
    for (i = 1; i <= n; i++) {
      int value = min(l[i], r[i]);
      if (value > max) max = value;
    }
    printf("%d\n", max);
  }
  return 0;
}
