#include <bits/stdc++.h>
using namespace std;
int L[100000 + 10];
int R[100000 + 10];
int H[100000 + 10];
int main() {
  int i, j, k;
  int n, m;
  int res = 1;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> H[i];
  L[1] = L[n] = R[1] = R[n] = 1;
  for (i = 2; i <= n; i++) L[i] = min(L[i - 1] + 1, H[i]);
  for (i = n - 1; i >= 1; i--) R[i] = min(R[i + 1] + 1, H[i]);
  res = 1;
  for (i = 1; i <= n; i++) {
    res = max(res, min(R[i], L[i]));
  }
  cout << res << endl;
  return 0;
}
