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