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