#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d = 1, a = 0;
  cin >> n;
  vector<int> v(n), m(n, 2000000000);
  for (int((i)) = (0); ((i)) < ((n)); ((i))++) cin >> v[i];
  for (int((i)) = (0); ((i)) < ((n)); ((i))++) {
    if (v[i] < d) d = v[i];
    m[i] = d;
    d++;
  }
  d = 1;
  for (int((i)) = ((n - 1)); ((i)) >= (0); ((i))--) {
    if (v[i] < d) d = v[i];
    a = max(min(m[i], d), a);
    d++;
  }
  cout << a;
}
