#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300010;
int h[MAXN], v[MAXN];
int main() {
  int n;
  scanf(" %d", &n);
  for (int i = 0; i < (n); ++i) {
    scanf(" %d", &h[i]);
  }
  v[0] = 1;
  v[n - 1] = 1;
  for (int i = (1); i < (n - 1); ++i) {
    v[i] = min(h[i], v[i - 1] + 1);
  }
  for (int i = n - 2; i >= 0; --i) {
    v[i] = min(v[i], min(h[i], v[i + 1] + 1));
  }
  int ans = -1;
  for (int i = 0; i < (n); ++i) ans = max(ans, v[i]);
  printf("%d\n", ans);
  return 0;
}
