#include <bits/stdc++.h>
using namespace std;
int n;
int h[101010];
int l[101010];
int r[101010];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> h[i];
  l[0] = 1;
  for (int i = 1; i < n; ++i) l[i] = min(h[i], l[i - 1] + 1);
  r[n - 1] = 1;
  for (int i = n - 2; i >= 0; --i) r[i] = min(h[i], r[i + 1] + 1);
  int m = 0;
  for (int i = 0; i < n; ++i) m = max(m, min(l[i], r[i]));
  cout << m << endl;
}
