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