#include <bits/stdc++.h>
using namespace std;
int n;
int h[123456];
int L[123456], R[123456];
bool input() {
  if (cin >> n) {
    for (int i = (int)(0), _t = (int)(n - 1); i <= _t; i++) cin >> h[i];
    return true;
  } else {
    return false;
  }
}
void solve() {
  L[0] = 1;
  for (int i = (int)(1), _t = (int)(n - 1); i <= _t; i++) {
    L[i] = min(L[i - 1] + 1, h[i]);
  }
  R[n - 1] = 1;
  for (int i = (int)(n - 2), _t = (int)(0); i >= _t; i--) {
    R[i] = min(R[i + 1] + 1, h[i]);
  }
  int ans = 0;
  for (int i = (int)(0), _t = (int)(n - 1); i <= _t; i++) {
    int tmp = min(L[i], R[i]);
    ans = max(ans, tmp);
  }
  cout << ans << endl;
}
int main() {
  while (input()) solve();
  return 0;
}
