#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int maxt = 1;
  int lmin;
  int rmin;
  int mint = 0;
  multiset<int> rmint;
  multiset<int> lmint;
  for (int i = 1; i < n; i++) {
    rmint.insert(a[i] + i);
  }
  lmint.insert(a[0]);
  multiset<int>::iterator it;
  multiset<int>::iterator it1;
  for (int i = 1; i < n - 1; i++) {
    it = (rmint.begin());
    rmin = (*it) - i;
    rmint.erase(rmint.find(a[i] + i));
    it1 = (lmint.begin());
    lmin = (*it1) + i;
    lmint.insert(a[i] - i);
    mint = min(min(lmin, rmin), min(min(a[i], i + 1), n - i));
    maxt = max(mint, maxt);
  }
  printf("%d", maxt);
  return 0;
}
