#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  vector<int> H;
  for (int i = 0; i < N; ++i) {
    int h;
    cin >> h;
    H.push_back(h);
  }
  vector<int> minPossibleSteps;
  minPossibleSteps.reserve(N);
  int currentMin = 0;
  for (int i = 0; i < N; ++i) {
    currentMin = min(currentMin + 1, H[i]);
    minPossibleSteps.push_back(currentMin);
  }
  currentMin = 0;
  for (int i = N - 1; i >= 0; --i) {
    currentMin = min(currentMin + 1, minPossibleSteps[i]);
    minPossibleSteps[i] = currentMin;
  }
  cout << *max_element(minPossibleSteps.begin(), minPossibleSteps.end())
       << endl;
  return 0;
}
