#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100002], b[100002];
  int n;
  cin >> n;
  a[0] = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i + 1];
  }
  a[n + 1] = 0;
  int best = 1;
  for (int i = 0; i < n; i++) {
    b[i + 1] = min(best, a[i + 1]);
    best = b[i + 1];
    best++;
  }
  best = 1;
  int ma = -INT_MAX;
  for (int i = n; i >= 1; i--) {
    b[i] = min(min(best, a[i]), b[i]);
    best = min(best, a[i]);
    best++;
    ma = max(ma, b[i]);
  }
  cout << ma;
  return 0;
}
