#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  int ans[n];
  ans[0] = 1;
  ans[n - 1] = 1;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 1; i <= n - 2; i++) {
    ans[i] = min(ans[i - 1] + 1, arr[i]);
  }
  for (int i = n - 2; i >= 1; i--) {
    ans[i] = min(ans[i], ans[i + 1] + 1);
  }
  int final_ans = 0;
  for (int i = 0; i < n; i++) {
    final_ans = max(final_ans, ans[i]);
  }
  cout << final_ans << endl;
  return 0;
}
