#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 6;
int h[maxn], L[maxn], R[maxn];
int main() {
  int n, i, j, ans = -1;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &h[i]);
  for (i = 1; i <= n; i++) L[i] = min(h[i], L[i - 1] + 1);
  for (i = n; i >= 1; i--) R[i] = min(h[i], R[i + 1] + 1);
  for (i = 1; i <= n; i++) ans = max(ans, min(L[i], R[i]));
  printf("%d\n", ans);
  return 0;
}
