#include <bits/stdc++.h>
using namespace std;
long long a[100100], lf[100100], rg[100100];
int main() {
  long long n, i, ans;
  scanf("%I64d", &n);
  for (i = 1; i < n + 1; i++) {
    scanf("%I64d", &a[i]);
  }
  a[0] = 0;
  a[n + 1] = 0;
  for (i = 1; i < n + 1; i++) {
    lf[i] = min(lf[i - 1] + 1, a[i]);
  }
  for (i = n; i >= 1; i--) {
    rg[i] = min(rg[i + 1] + 1, a[i]);
  }
  ans = 0;
  for (i = 1; i < n + 1; i++) {
    ans = max(ans, min(rg[i], lf[i]));
  }
  printf("%I64d\n", ans);
}
