#include <bits/stdc++.h>
using namespace std;
int n, v[100001], l[100001], r[100001];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", v + i);
  int res = 0;
  l[0] = r[0] = 1;
  l[n - 1] = r[n - 1] = 1;
  for (int i = 1; i + 1 < n; ++i) {
    l[i] = min(l[i - 1] + 1, v[i]);
  }
  for (int i = n - 2; i > 0; --i) {
    r[i] = min(r[i + 1] + 1, v[i]);
  }
  for (int i = 0; i < n; ++i) res = max(res, min(l[i], r[i]));
  cout << res << endl;
  return 0;
}
