#include <bits/stdc++.h>
using namespace std;
int h1[100010];
int main() {
  int m;
  while (scanf("%d", &m) != EOF) {
    int i;
    for (i = 1; i <= m; i++) scanf("%d", &h1[i]);
    h1[0] = 0;
    h1[m + 1] = 0;
    for (i = 1; i <= m; i++) h1[i] = min(h1[i], h1[i - 1] + 1);
    for (i = m; i >= 1; i--) h1[i] = min(h1[i], h1[i + 1] + 1);
    printf("%d\n", *max_element(h1, h1 + m + 1));
  }
}
