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