#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:256000000")
const long double eps = 0.00000001;
vector<int> a, ans;
int main() {
  int n, i;
  cin >> n;
  a.resize(n);
  ans.resize(n);
  for (i = 0; i < n; i++) cin >> a[i];
  int worst = 0;
  for (i = 0; i < n; i++) {
    worst = min(worst, a[i] - i - 1);
    ans[i] = worst + i + 1;
  }
  worst = n + 1;
  for (i = n - 1; i >= 0; i--) {
    worst = min(worst, a[i] + i + 1);
    ans[i] = min(ans[i], worst - i - 1);
  }
  int res = -1e9;
  for (i = 0; i < n; i++) {
    res = max(res, ans[i]);
  }
  cout << res;
}
