#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int n, l[N], ans[N], d;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> l[i];
  for (int i = 0; i < n; ++i) {
    d = min(d, l[i] - i - 1);
    ans[i] = d + i + 1;
  }
  d = n + 1;
  for (int i = n - 1; i > -1; --i) {
    d = min(d, l[i] + i + 1);
    ans[i] = min(ans[i], d - i - 1);
  }
  cout << *max_element(ans, ans + n);
}
