#include <bits/stdc++.h>
using namespace std;
int a[105000];
int l[105000];
int r[105000];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    a[0] = 0;
    a[n + 1] = 0;
    l[0] = 0;
    l[n + 1] = 0;
    r[0] = 0;
    r[n + 1] = 0;
    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 output = 0;
    for (int i = 1; i <= n; i++) {
      output = max(output, min(l[i], r[i]));
    }
    printf("%d\n", output);
  }
}
