#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 7;
int n;
int a[N];
int L[N], R[N];
string s, s1;
int solve() {
  int q = 1;
  int ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < n; i++) {
    q = min(q, a[i]);
    L[i] = q;
    q++;
  }
  q = 1;
  for (int i = n - 1; i >= 0; i--) {
    q = min(q, a[i]);
    R[i] = q;
    q++;
  }
  for (int i = 0; i < n; i++) ans = max(ans, min(L[i], R[i]));
  printf("%d\n", ans);
  return 0;
}
int main() { solve(); }
