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