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