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