#include <bits/stdc++.h>
using namespace std;
const int MAX = 100005;
int arr[MAX], A[MAX], B[MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans++;
    ans = min(ans, arr[i]);
    A[i] = ans;
  }
  reverse(arr, arr + n);
  ans = 0;
  for (int i = 0; i < n; i++) {
    ans++;
    ans = min(ans, arr[i]);
    B[i] = ans;
  }
  ans = 0;
  reverse(B, B + n);
  for (int i = 0; i < n; i++) ans = max(ans, min(A[i], B[i]));
  cout << ans << endl;
  return 0;
}
