#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int Scan() {
  int res = 0, ch, flag = 0;
  if ((ch = getchar()) == '-')
    flag = 1;
  else if (ch >= '0' && ch <= '9')
    res = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') res = res * 10 + ch - '0';
  return flag ? -res : res;
}
int h[100000 + 5];
int ans[100000 + 5];
int main() {
  int n;
  scanf("%d", &(n));
  for (int i = 1; i <= n; i++) scanf("%d", &(h[i]));
  ans[0] = ans[n + 1] = 0;
  for (int i = 1; i <= n; i++) {
    ans[i] = min(h[i], i);
    ans[i] = min(ans[i - 1] + 1, ans[i]);
  }
  for (int i = n; i >= 1; i--) {
    ans[i] = min(ans[i], n - i + 1);
    ans[i] = min(ans[i + 1] + 1, ans[i]);
  }
  int res = 0;
  for (int i = 1; i <= n; i++) res = max(res, ans[i]);
  printf("%d\n", res);
  return 0;
}
