#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> H;
  for (int i = 0; i < n; ++i) {
    int h;
    cin >> h;
    H.push_back(h);
  }
  vector<int> A(n), B(n);
  for (int i = 0; i < n; ++i) {
    int prev = 1 + (i == 0 ? 0 : A[i - 1]);
    prev = A[i] = min(prev, H[i]);
  }
  for (int i = n - 1; i >= 0; --i) {
    int prev = 1 + (i == n - 1 ? 0 : B[i + 1]);
    prev = B[i] = min(prev, H[i]);
  }
  int ans = -1;
  for (int i = 0; i < n; ++i) {
    ans = max(ans, min(A[i], B[i]));
  }
  cout << ans << "\n";
  return 0;
}
