#include <bits/stdc++.h>
using namespace std;
int F(const void* l, const void* r) { return (*(int*)l - *(int*)r); }
const long long inf = 10000000007;
int n;
long long c;
long long a[101010];
long long b[101010];
priority_queue<pair<long long, int> > q;
int main() {
  ios::ios_base::sync_with_stdio(false);
  cin >> n;
  vector<long long> k;
  long long m = inf;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    q.push(make_pair(-a[i], i));
    b[i] = min(i + 1, n - i);
  }
  pair<long long, int> f;
  while (!q.empty()) {
    f = q.top();
    q.pop();
    long long w = -f.first;
    int j = f.second;
    b[j] = min(b[j], w);
    if (j != n - 1) {
      if (b[j + 1] > b[j] + 1) {
        b[j + 1] = b[j] + 1;
        q.push(make_pair(-b[j + 1], j + 1));
      }
    }
    if (j != 0) {
      if (b[j - 1] > b[j] + 1) {
        b[j - 1] = b[j] + 1;
        q.push(make_pair(-b[j - 1], j - 1));
      }
    }
  }
  for (long long i = 0; i < n; i++) c = max(c, b[i]);
  cout << c;
  return 0;
}
