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