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