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