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