#include <bits/stdc++.h>
using namespace std;
int n, h[100009], e1[100009], e2[100009], v, ans = 0, r[100009];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &h[i]);
  }
  e1[1] = e1[n] = 1;
  for (int i = 2; i < n; i++) {
    e1[i] = min(h[i], e1[i - 1] + 1);
  }
  e2[1] = e2[n] = 1;
  for (int i = n - 1; i >= 2; i--) {
    e2[i] = min(h[i], e2[i + 1] + 1);
  }
  for (int i = 1; i <= n; i++) {
    r[i] = min(e1[i], e2[i]);
    ans = max(ans, r[i]);
  }
  printf("%d", ans);
  return 0;
}
