#include <bits/stdc++.h>
int Max(int a, int b) { return a > b ? a : b; }
int Min(int a, int b) { return a < b ? a : b; }
int main() {
  int n, i, h[100005], a[100005];
  while (scanf("%d", &n) == 1) {
    for (i = 1; i <= n; i++) scanf("%d", &h[i]);
    int p = 0;
    for (i = 1; i <= n; i++) p = Min(p, h[i] - i), a[i] = i + p;
    p = n + 1;
    int ans = 0;
    for (i = n; i >= 1; i--)
      p = Min(p, h[i] + i), a[i] = Min(a[i], p - i), ans = Max(ans, a[i]);
    printf("%d\n", ans);
  }
  return 0;
}
