#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, y;
  scanf("%d", &n);
  vector<int> v(n), dp1(n, 0), dp2(n, 0);
  for (i = 0; i < n; i++) scanf("%d", &v[i]);
  y = 0, dp1[0] = 1, dp2[n - 1] = 1;
  for (i = 1; i < n; i++) dp1[i] = min(1 + dp1[i - 1], v[i]);
  for (i = n - 2; i >= 0; i--) dp2[i] = min(1 + dp2[i + 1], v[i]);
  for (i = 0; i < n; i++) y = max(y, min(dp1[i], dp2[i]));
  cout << y << endl;
  return 0;
}
