#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 100100;
int n, h[N], ans[N], l[N], r[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> h[i];
    ans[i] = min(i, n - i + 1);
  }
  for (int i = 1; i <= n; i++) l[i] = min(h[i], l[i - 1] + 1);
  for (int i = n; i >= 1; i--) r[i] = min(h[i], r[i + 1] + 1);
  for (int i = 1; i <= n; i++) ans[i] = min(ans[i], min(l[i], r[i]));
  cout << *max_element(ans + 1, ans + 1 + n);
}
