#include <bits/stdc++.h>
using namespace std;
int ar[1000009];
int l[1000009];
int r[1000009];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
  }
  for (int i = 1; i <= n; i++) {
    l[i] = min(l[i - 1] + 1, ar[i]);
  }
  for (int i = n; i > 0; i--) {
    r[i] = min(r[i + 1] + 1, ar[i]);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, min(l[i], r[i]));
  }
  cout << ans << "\n";
  return 0;
}
