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