#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[100009] = {0};
  int res[100009] = {0};
  for (int i = 1; i <= n; i++) cin >> a[i];
  int lans = 1000000009;
  for (int i = 0; i <= n + 1; i++) {
    lans = min(lans, a[i] - i);
    res[i] = lans + i;
  }
  lans = 1000000009;
  for (int i = n + 1; i >= 0; i--) {
    lans = min(lans, a[i] + i);
    res[i] = min(res[i], lans - i);
  }
  lans = 0;
  for (int i = 1; i <= n; i++) lans = max(lans, res[i]);
  cout << lans << endl;
  return 0;
}
