#include <bits/stdc++.h>
using namespace std;
int a[100005], n, b[100005], c[100005];
int main() {
  while (cin >> n) {
    for (int i = 1; i <= n; i++) cin >> a[i];
    a[0] = 0, a[n + 1] = 0;
    for (int i = 1; i <= n; i++) b[i] = min(a[i], b[i - 1] + 1);
    for (int i = n; i >= 1; i--) c[i] = min(a[i], c[i + 1] + 1);
    int ans = 0;
    for (int i = 1; i <= n; i++) ans = max(ans, min(b[i], c[i]));
    cout << ans << endl;
  }
  return 0;
}
