#include <bits/stdc++.h>
using namespace std;
int h[100010], l[100010], r[100010];
int main() {
  int n;
  while (cin >> n) {
    for (int i = 1; i <= n; i++) cin >> h[i];
    l[1] = 1;
    for (int i = 2; i <= n; i++) l[i] = min(l[i - 1] + 1, h[i]);
    r[n] = 1;
    for (int i = n - 1; i >= 1; i--) r[i] = min(r[i + 1] + 1, h[i]);
    int minn = 0;
    for (int i = 1; i <= n; i++) minn = max(minn, min(l[i], r[i]));
    cout << minn << endl;
  }
  return 0;
}
