#include <bits/stdc++.h>
using namespace std;
const int nmax = 100005;
const int mod = 1e9 + 7;
const long long inf = 1e9;
const double EPS = 1e-6;
int a[nmax];
int l[nmax], r[nmax];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; ++i) {
    int old = l[i - 1];
    if (a[i] > old) {
      l[i] = old + 1;
    } else {
      l[i] = a[i];
    }
  }
  for (int i = n; i >= 1; --i) {
    int old = r[i + 1];
    if (a[i] > old) {
      r[i] = old + 1;
    } else {
      r[i] = a[i];
    }
  }
  int res = 0;
  for (int i = 1; i <= n; ++i) {
    res = max(res, min(l[i], r[i]));
  }
  printf("%d\n", res);
  return 0;
}
