#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
long long a[100005];
long long r[100005];
long long l[100005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], l[i] = r[i] = 0x7fffffff;
  for (int i = n - 1; i >= 0; i--) {
    if (i == n - 1)
      r[i] = 1;
    else
      r[i] = min(a[i], r[i + 1] + 1);
  }
  for (int i = 0; i < n; i++) {
    if (i == 0)
      l[i] = 1;
    else {
      l[i] = min(l[i], r[i]);
      l[i] = min(l[i], l[i - 1] + 1);
    }
  }
  long long maaax = -100000;
  for (int i = 0; i < n; i++) maaax = max(l[i], maaax);
  cout << maaax << endl;
}
