#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> h(n);
  for (int i = 0; i < n; i++) cin >> h[i];
  vector<int> dp1(n);
  dp1[0] = 1;
  for (int i = 1; i < n; i++) {
    dp1[i] = min(dp1[i - 1] + 1, h[i]);
  }
  vector<int> dp2(n);
  dp2[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--) {
    dp2[i] = min(dp2[i + 1] + 1, h[i]);
  }
  int ret = -1;
  for (int i = 0; i < n; i++) {
    ret = max(ret, min(dp1[i], dp2[i]));
  }
  cout << ret;
}
