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