#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, a[N], L[N], R[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int q = 1;
  for (int i = 1; i <= n; i++) {
    q = min(q, a[i]);
    L[i] = q;
    q++;
  }
  q = 1;
  for (int i = n; i >= 1; i--) {
    q = min(q, a[i]);
    R[i] = q;
    q++;
  }
  int res = 0;
  for (int i = 1; i <= n; i++) res = max(res, min(L[i], R[i]));
  cout << res << endl;
}
