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