#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int arr[100000 + 10];
  int chk[100000 + 10];
  memset(chk, 63, sizeof chk);
  cin >> n;
  arr[0] = 0;
  chk[0] = 0;
  chk[n + 1] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  for (int i = 1; i <= n; i++) {
    chk[i] = min(chk[i], min(chk[i - 1] + 1, arr[i]));
  }
  for (int i = n; i >= 1; i--) {
    chk[i] = min(chk[i], min(chk[i + 1] + 1, arr[i]));
  }
  int mx = -1;
  for (int i = 1; i <= n; i++) {
    mx = max(mx, chk[i]);
  }
  cout << mx << endl;
}
