#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int h[n];
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  int fdp[n], ldp[n];
  fdp[0] = 1;
  for (int i = 1; i < n; i++) {
    fdp[i] = min(fdp[i - 1], h[i] - 1) + 1;
  }
  ldp[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--) {
    ldp[i] = min(ldp[i + 1], h[i] - 1) + 1;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans = max(ans, min(fdp[i], ldp[i]));
  }
  cout << ans << endl;
}
