#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
int main() {
  long long n, i;
  cin >> n;
  vector<long long> v(n), w(n), x(n);
  for (i = 0; i < n; i++) cin >> v[i];
  w[0] = 1;
  for (i = 1; i < n; i++) w[i] = min(v[i], w[i - 1] + 1);
  x[n - 1] = 1;
  for (i = n - 2; i >= 0; i--) x[i] = min(v[i], x[i + 1] + 1);
  long long ma = 0;
  for (i = 0; i < n; i++) ma = max(ma, min(w[i], x[i]));
  cout << ma << endl;
}
