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