#include <bits/stdc++.h>
int main() {
  int n;
  int e[100005] = {0};
  scanf("%d", &n);
  int max = -1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &e[i]);
  }
  int j = 1;
  for (int i = 1; i <= n; i++) {
    if (j < e[i]) {
      e[i] = j;
    } else
      j = e[i];
    j++;
  }
  j = 1;
  for (int i = n; i >= 1; i--) {
    if (j < e[i]) {
      e[i] = j;
    } else
      j = e[i];
    j++;
    if (e[i] > max) max = e[i];
  }
  printf("%d\n", max);
}
