#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> height(n);
  for (int i = 0; i < n; i++) cin >> height[i];
  height[0] = 1;
  height[n - 1] = 1;
  vector<int> numPlus(n);
  vector<int> numMinus(n);
  for (int i = 0; i < n; i++) {
    numPlus[i] = height[i] + i;
    numMinus[i] = height[i] - i;
  }
  vector<int> ansPlus(n), ansMinus(n);
  ansPlus[n - 1] = numPlus[n - 1];
  for (int i = n - 2; i >= 0; i--) ansPlus[i] = min(numPlus[i], ansPlus[i + 1]);
  ansMinus[0] = numMinus[0];
  for (int i = 1; i < n; i++) ansMinus[i] = min(ansMinus[i - 1], numMinus[i]);
  vector<int> ans(n);
  int total = 1;
  for (int i = 1; i < n - 1; i++) {
    ans[i] = height[i];
    ans[i] = min(ans[i], ansMinus[i - 1] + i);
    ans[i] = min(ans[i], ansPlus[i + 1] - i);
    total = max(total, ans[i]);
  }
  cout << total << endl;
  return 0;
}
