#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000009;
const double esp = 1e-13;
const double pi = 3.141592653589;
long long canhai(long long n) {
  long long fi, la, mid;
  fi = 0;
  la = n + 1;
  while (fi + 1 < la) {
    mid = fi / 2 + la / 2;
    if (fi % 2 && la % 2) mid++;
    if (mid > n / mid)
      la = mid;
    else
      fi = mid;
  }
  return fi;
}
long long power(long long a, long long n, long long m) {
  if (n == 0) return 1;
  long long tmp, c;
  tmp = c = a;
  n--;
  while (n) {
    if (n % 2) tmp = tmp * c % m;
    c = c * c % m;
    n /= 2;
  }
  return tmp;
}
int n, a[100000 + 10], l[100000 + 10], r[100000 + 10], ans, f[100000 + 10];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  l[1] = 1;
  for (int i = 2; i <= n; i++) l[i] = min(min(l[i - 1] + 1, i), a[i]);
  r[n] = 1;
  for (int i = n - 1; i >= 1; i--)
    r[i] = min(n - i + 1, min(a[i], r[i + 1] + 1));
  for (int i = 1; i <= n; i++) ans = max(ans, min(l[i], r[i]));
  cout << ans;
}
