#include <bits/stdc++.h>
using namespace std;
int n, h[100100], t[100100];
int main() {
  int svr = 0;
  scanf("%d", &n);
  for (int i = 1; i < int(n + 1); ++i) scanf("%d", h + i);
  for (int i = 1; i < int(n + 1); ++i) t[i] = min(t[i - 1] + 1, h[i]);
  for (int i = (n + 1) - 1; i >= int(1); --i)
    t[i] = min(t[i], t[i + 1] + 1), svr = max(svr, t[i]);
  printf("%d\n", svr);
}
