#include <bits/stdc++.h>
using namespace std;
long long a[10000000], ans[10000000];
int main() {
  long long n, i;
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    ans[i] = a[i];
  }
  long long c = 1;
  for (i = 1; i <= n; i++) ans[i] = min(ans[i], c++);
  c = 1;
  for (i = n; i >= 1; i--) {
    ans[i] = min(ans[i], c++);
  }
  long long m = 2;
  for (i = 2; i <= n; i++) {
    ans[i] = min(m, ans[i]);
    m = min(m, ans[i]);
    m++;
  }
  m = 2;
  for (i = n - 1; i >= 1; i--) {
    ans[i] = min(m, ans[i]);
    m = min(m, ans[i]);
    m++;
  }
  long long mini = 0;
  for (i = 1; i <= n; i++) mini = max(mini, ans[i]);
  printf("%lld\n", mini);
  return 0;
}
