#include <bits/stdc++.h>
using namespace std;
const int SIZE = 100000;
int h[SIZE + 2], n;
void print() {
  return;
  for (int i = 1; i <= n; i++) cout << h[i] << " ";
  cout << endl;
}
int main() {
  int res = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> h[i];
    if (h[i - 1] + 1 < h[i]) h[i] = h[i - 1] + 1;
  }
  print();
  for (int i = n; i >= 1; i--) {
    if (h[i + 1] + 1 < h[i]) h[i] = h[i + 1] + 1;
  }
  print();
  for (int i = 1; i <= n; i++)
    if (h[i] > res) res = h[i];
  cout << res << endl;
  return 0;
}
