#include <bits/stdc++.h>
using namespace std;
const int nmax = 100000;
int a[nmax + 5];
int Mins[nmax + 5];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  a[n + 1] = n + 1;
  Mins[n + 1] = n + 1;
  for (int i = n; i >= 0; i--) Mins[i] = min(Mins[i + 1], a[i] + i);
  int Min_left = 0;
  int ans = -1;
  for (int i = 1; i <= n; i++) {
    Min_left = min(Min_left, a[i - 1]) + 1;
    ans = max(ans, min(Min_left, Mins[i] - i));
  }
  printf("%d\n", ans);
  return 0;
}
