#include <bits/stdc++.h>
using namespace std;
int n;
const int maxn = 1e5 + 100;
int a[maxn];
int pre[maxn], nxt[maxn];
int dp[maxn];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    memset(dp, 0, sizeof(dp));
    pre[0] = nxt[n - 1] = 1;
    for (int i = 1; i < n; i++) {
      pre[i] = min(pre[i - 1] + 1, a[i]);
    }
    for (int i = n - 2; i >= 0; i--) nxt[i] = min(nxt[i + 1] + 1, a[i]);
    for (int i = 0; i < n; i++) dp[i] = min(pre[i], nxt[i]);
    int minx = 0;
    for (int i = 0; i < n; i++) minx = max(minx, dp[i]);
    printf("%d\n", minx);
  }
}
