#include <bits/stdc++.h>
using namespace std;
const int sz = 100005;
int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  int ans = 0;
  vector<int> left(n, 1), right(n, 1);
  for (int i = 1; i < n; i++) left[i] = min(1 + left[i - 1], A[i]);
  for (int i = n - 2; i >= 0; i--) right[i] = min(1 + right[i + 1], A[i]);
  for (int i = 0; i < n; i++) ans = max(ans, min(left[i], right[i]));
  cout << ans << endl;
}
