#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5) + 10;
int h[N], Left[N], Right[N];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> h[i];
  }
  for (int i = 1; i <= n; i++) {
    Left[i] = min(Left[i - 1] + 1, h[i]);
  }
  for (int i = n; i >= 1; i--) {
    Right[i] = min(Right[i + 1] + 1, h[i]);
  }
  int ans = -1;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, min(Left[i], Right[i]));
  }
  cout << ans << "\n";
  return 0;
}
