#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100001], c[100001] = {0}, d[100001], n, i, j, k, max = 0;
  cin >> n;
  d[1] = 1;
  d[n] = 1;
  c[1] = 1;
  c[n] = 1;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 2; i < n; i++) c[i] = min(c[i - 1] + 1, min(a[i + 1] + 1, a[i]));
  for (i = n - 1; i >= 1; i--)
    d[i] = min(d[i + 1] + 1, min(a[i - 1] + 1, a[i]));
  for (i = 1; i <= n; i++)
    if (d[i] < c[i]) c[i] = d[i];
  for (i = 1; i <= n; i++)
    if (c[i] > max) max = c[i];
  cout << max;
  return 0;
}
