#include <bits/stdc++.h>
int main() {
  int i, n, max, k;
  static int h[100000], l[100000], r[100000];
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &h[i]);
  l[0] = 1;
  for (i = 1; i < n; i++) l[i] = h[i] < l[i - 1] + 1 ? h[i] : l[i - 1] + 1;
  r[n - 1] = 1;
  for (i = n - 2; i >= 0; i--) r[i] = h[i] < r[i + 1] + 1 ? h[i] : r[i + 1] + 1;
  max = 0;
  for (i = 0; i < n; i++) {
    k = l[i] < r[i] ? l[i] : r[i];
    if (max < k) max = k;
  }
  printf("%d\n", max);
  return 0;
}
