#include <bits/stdc++.h>
using namespace std;
int a;
vector<int> v, l, r;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    v.push_back(x);
  }
  int c = 1;
  for (int i = 0; i < n; i++) {
    l.push_back(min(c, v[i]));
    c = min(c, v[i]) + 1;
  }
  c = 1;
  for (int i = n - 1; i >= 0; i--) {
    r.push_back(min(c, v[i]));
    c = min(c, v[i]) + 1;
  }
  reverse(r.begin(), r.end());
  int res = 0;
  for (int i = 0; i < n; i++) res = max(res, min(l[i], r[i]));
  cout << res << endl;
}
