#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int maxn = 1e5 + 5;
long long h[maxn], l[maxn], r[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lld", &h[i]);
  l[1] = r[n] = 1;
  for (int i = 2; i <= n; ++i) l[i] = min(h[i], l[i - 1] + 1);
  for (int i = n - 1; i >= 1; --i) r[i] = min(h[i], r[i + 1] + 1);
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    long long now = min(l[i], r[i]);
    if (now > ans) ans = now;
  }
  printf("%lld\n", ans);
  return 0;
}
