#include <bits/stdc++.h>
using namespace std;
int v[100001], dp[100002];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", v + i);
    dp[i] = v[i];
  }
  int asw = 0;
  for (int j = 1; j <= n; j++) dp[j] = min(dp[j - 1] + 1, dp[j]);
  for (int j = n; j >= 1; j--) {
    dp[j] = min(dp[j + 1] + 1, dp[j]);
    asw = max(asw, dp[j]);
  }
  printf("%d", asw);
  return 0;
}
