#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, a[N], f[N], la[N], ra[N], l[N], r[N];
void minimize(int &a, int b) {
  if (b < a) a = b;
}
bool compare(int i, int j) { return a[i] < a[j]; }
int main() {
  scanf("%d", &n);
  a[0] = 2e9;
  a[n + 1] = 2e9;
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  for (int i = 1; i <= n; ++i) la[i] = a[i] - i, ra[i] = a[i] + i;
  l[1] = 2e9;
  for (int i = 2; i <= n; ++i) l[i] = min(l[i - 1], la[i - 1]);
  r[n] = 2e9;
  for (int i = n - 1; i >= 1; --i) r[i] = min(r[i + 1], ra[i + 1]);
  for (int i = 1; i <= n; ++i) f[i] = a[i];
  for (int i = 1; i <= n; ++i) minimize(f[i], min(i, n - i + 1));
  for (int i = 1; i <= n; ++i) {
    minimize(f[i], min(l[i] + i, r[i] - i));
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) ans = max(ans, f[i]);
  printf("%d\n", ans);
  return 0;
}
