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