#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 5;
int side[M], cnt[M];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &side[i]);
  }
  int cur = 0;
  for (int i = 1; i <= n; ++i) {
    cur = min(side[i] - i, cur);
    cnt[i] = i + cur;
  }
  cur = n + 1;
  for (int i = n; i >= 1; --i) {
    cur = min(side[i] + i, cur);
    cnt[i] = min(cur - i, cnt[i]);
  }
  cur = 0;
  for (int i = 1; i <= n; ++i) {
    cur = max(cur, cnt[i]);
  }
  printf("%d\n", cur);
  return 0;
}
