#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n, h[100100];
int pref[100100], suff[100100];
int get(int ind) {
  int res = min(ind + 1, n - ind);
  res = min(res, h[ind]);
  if (ind > 0) res = min(res, pref[ind - 1] + ind);
  if (ind + 1 < n) res = min(res, suff[ind + 1] - ind);
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", h + i);
  pref[0] = h[0] - 0;
  for (int i = 1; i < n; i++) pref[i] = min(pref[i - 1], h[i] - i);
  suff[n - 1] = h[n - 1] + n - 1;
  for (int i = n - 2; i >= 0; i--) suff[i] = min(suff[i + 1], h[i] + i);
  int ans = -1;
  for (int i = 0; i < n; i++) {
    ans = max(ans, get(i));
  }
  printf("%d\n", ans);
  return 0;
}
