#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int a[N], b[N];
int h[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> h[i];
  }
  a[1] = 1;
  for (int i = 2; i <= n; i++) {
    a[i] = min(h[i], a[i - 1] + 1);
  }
  b[n] = 1;
  for (int i = n - 1; i >= 1; i--) {
    b[i] = min(b[i + 1] + 1, h[i]);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, min(a[i], b[i]));
  }
  cout << ans;
  return 0;
}
