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