#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int *a = (int *)malloc(n * sizeof(int));
  int *b = (int *)malloc(n * sizeof(int));
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    b[i] = min(i + 1, a[i]);
    if (i != 0) {
      b[i] = min(b[i - 1] + 1, b[i]);
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    b[i] = min(n - i, b[i]);
    if (i != n - 1) {
      b[i] = min(b[i + 1] + 1, b[i]);
    }
  }
  int ans = b[0];
  for (int i = 0; i < n; i++)
    if (b[i] > ans) ans = b[i];
  cout << ans;
  return 0;
}
