#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  int dp1[n], dp2[n];
  dp1[0] = 1;
  for (i = 1; i < n; i++) {
    dp1[i] = min(a[i], dp1[i - 1] + 1);
  }
  dp2[n - 1] = 1;
  for (i = n - 2; i >= 0; i--) {
    dp2[i] = min(a[i], dp2[i + 1] + 1);
  }
  int ans = 0;
  for (i = 0; i < n; i++) {
    dp1[i] = min(dp1[i], dp2[i]);
    ans = max(ans, dp1[i]);
  }
  cout << ans;
}
