#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m;
int f[N], a[N], r[N];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  int ans = 1;
  for (int i = 0; i < n; i++) {
    if (i == 0 || i == n - 1) {
      f[i] = 1;
      continue;
    }
    f[i] = min(f[i - 1] + 1, min(a[i - 1] + 1, min(a[i], a[i + 1] + 1)));
  }
  for (int i = n - 2; i >= 0; i--) {
    f[i] = min(f[i], f[i + 1] + 1);
    ans = max(ans, f[i]);
  }
  cout << ans;
}
