#include <bits/stdc++.h>
using namespace std;
const int N = 110000;
int arr[N];
int left1[N];
int right1[N];
int n, m;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  arr[0] = arr[n + 1] = 0;
  for (int i = 1; i <= n; i++) left1[i] = min(arr[i], left1[i - 1] + 1);
  for (int i = n; i >= 1; i--) right1[i] = min(arr[i], right1[i + 1] + 1);
  int ret = 0;
  for (int i = 1; i <= n; i++) {
    ret = max(min(left1[i], right1[i]), ret);
  }
  cout << ret << endl;
  return 0;
}
