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