#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
int ar[maxn];
int x[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &ar[i]);
  for (int i = 1; i <= n; i++) x[i] = min(x[i - 1] + 1, ar[i]);
  for (int i = n; i >= 1; i--) x[i] = min(x[i], x[i + 1] + 1);
  int mx = -1;
  for (int i = 1; i <= n; i++) mx = max(mx, x[i]);
  printf("%d\n", mx);
  return 0;
}
