#include <bits/stdc++.h>
using namespace std;
int t[100000 + 10];
int d[100000 + 10];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> t[i];
  d[0] = 1;
  d[n - 1] = 1;
  int help;
  for (int i = 1; i < n - 1; ++i) {
    d[i] = i + 1;
    d[i] = min(d[i], n - i);
    if ((t[i + 1] >= t[i]) && (t[i] <= t[i - 1]))
      d[i] = min(d[i], t[i]);
    else {
      help = min(t[i + 1], t[i - 1]);
      d[i] = min(d[i], help + 1);
    }
  }
  for (int i = 1; i < n; ++i) d[i] = min(d[i], d[i - 1] + 1);
  for (int i = n - 2; i > -1; --i) d[i] = min(d[i], d[i + 1] + 1);
  int maax = -10;
  for (int i = 0; i < n; ++i) maax = max(maax, d[i]);
  cout << maax;
}
