#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 100010;
int a[N], b[N];
int n, l;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) {
    l = min(l, a[i] - i);
    b[i] = l + i;
  }
  l = n + 1;
  for (int i = n; i >= 1; --i) {
    l = min(l, a[i] + i);
    b[i] = min(b[i], l - i);
  }
  int ans = -1;
  for (int i = 1; i <= n; ++i) ans = max(ans, b[i]);
  printf("%d\n", ans);
  return 0;
}
