#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 + 100;
int h[maxn], r2[maxn], l2[maxn], m[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
  for (int i = 1; i <= n; i++) {
    l2[i] = min(h[i], l2[i - 1] + 1);
  }
  for (int i = n; i >= 1; i--) {
    r2[i] = min(h[i], r2[i + 1] + 1);
  }
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    m[i] = min(l2[i], r2[i]);
    mx = max(mx, m[i]);
  }
  cout << mx << endl;
}
