#include <bits/stdc++.h>
using namespace std;
ifstream fin("fisier.in");
ofstream fout("fisier.out");
int v[1000000], minl[1000000], minr[1000000];
int main() {
  int n, i;
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> v[i];
  for (i = 1; i <= n; ++i) minl[i] = min(minl[i - 1] + 1, v[i]);
  for (i = n; i >= 1; --i) minr[i] = min(minr[i + 1] + 1, v[i]);
  int res = 0;
  for (i = 1; i <= n; ++i) res = max(res, min(minr[i], minl[i]));
  cout << res;
  return 0;
}
