#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, maxm = INT_MIN;
  cin >> n;
  int a[n];
  for (__typeof(0) i = (0); i < (n); i++) cin >> a[i];
  int ans[n];
  ans[0] = 1;
  for (__typeof(1) i = (1); i < (n); i++) ans[i] = min(ans[i - 1] + 1, a[i]);
  ans[n - 1] = 1;
  for (__typeof(n - 2) i = (n - 2); i >= (0); i--)
    ans[i] = min(ans[i], ans[i + 1] + 1);
  for (__typeof(0) i = (0); i < (n); i++) maxm = max(maxm, ans[i]);
  cout << maxm << endl;
}
