#include <bits/stdc++.h>
using namespace std;
void print(int* t, int n) {
  for (int i = 0; i < n; i++) {
    printf("%d ", *(t + i));
  }
  printf("\n");
}
int main() {
  int n;
  scanf("%d", &n);
  int g[n], d[n];
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    g[i] = x + n - 1 - i;
    d[i] = x + i;
  }
  for (int i = 1; i < n; i++) g[i] = min(g[i], g[i - 1]);
  for (int i = n - 2; i >= 0; i--) d[i] = min(d[i], d[i + 1]);
  int v = 0;
  for (int i = 0; i < n; i++)
    v = max(v, min(min(g[i] - (n - 1 - i), i + 1), min(d[i] - i, n - i)));
  printf("%d", v);
}
