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