#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2 * 1e5;
const int INF = 1e9 + 7;
int n, a[MAXN], res[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int mmin = 0;
  a[0] = 0;
  a[n + 1] = 0;
  for (int i = 1; i <= n; i++) {
    res[i] = min(mmin + 1, a[i]);
    mmin = res[i];
  }
  mmin = 0;
  for (int i = n; i > 0; i--) {
    res[i] = min(res[i], min(mmin + 1, a[i]));
    mmin = res[i];
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, res[i]);
  cout << ans;
  return 0;
}
