#include <bits/stdc++.h>
const char en = '\n';
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long> V(n + 47, 1000000000000000047), L = V, P = V;
  L[0] = 0;
  L[n + 1] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> V[i];
  }
  bool changed = 1;
  while (changed) {
    changed = 0;
    for (int i = 1; i <= n; i++) {
      long long pred = L[i];
      L[i] = min(min(L[i - 1] + 1, V[i]), L[i]);
      if (pred != L[i]) changed = 1;
    }
    for (int i = n; i > 0; i--) {
      long long pred = L[i];
      L[i] = min(min(L[i + 1] + 1, V[i]), L[i]);
      if (pred != L[i]) changed = 1;
    }
  }
  long long mi = -1;
  for (int i = 1; i <= n; i++) {
    mi = max(mi, L[i]);
  }
  cout << mi << en;
}
