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