#include <bits/stdc++.h>
using namespace std;
const int N = 110000;
int n, arr[N];
int num[N][2];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  int len = 1;
  num[0][0] = 1;
  for (int i = 1; i < n; i++) {
    if (arr[i] > len)
      num[i][0] = ++len;
    else {
      num[i][0] = arr[i];
      len = arr[i];
    }
  }
  len = 1;
  num[n - 1][1] = 1;
  for (int i = n - 2; i >= 0; i--) {
    if (arr[i] > len)
      num[i][1] = ++len;
    else {
      num[i][1] = arr[i];
      len = arr[i];
    }
  }
  int ans = 1;
  for (int i = 0; i < n; i++) {
    ans = max(ans, min(num[i][0], num[i][1]));
  }
  printf("%d\n", ans);
}
