#include <bits/stdc++.h>
#pragma warning(disable : 4996)
const double PI = 3.1415926535897932384626433832795;
using namespace std;
const int mod = 1e9 + 7;
int n, m[100007], l[100007], r[100007];
void sol() {
  int i, ans;
  for (i = 0; i < n; i++) {
    scanf("%d", &m[i]);
  }
  l[0] = 1;
  r[n - 1] = 1;
  for (i = 1; i < n; i++) {
    l[i] = min(l[i - 1] + 1, m[i]);
  }
  for (i = n - 2; i >= 0; i--) {
    r[i] = min(r[i + 1] + 1, m[i]);
  }
  ans = -1;
  for (i = 0; i < n; i++) {
    ans = max(ans, min(l[i], r[i]));
  }
  printf("%d", ans);
}
int main() {
#pragma comment(linker, "/STACK:268435456")
  while (scanf("%d\n", &n) != EOF) sol();
  return 0;
}
