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