#include <bits/stdc++.h>
using namespace std;
const long long int MAXN = 1e6 + 10;
long long int a[MAXN], r[MAXN], l[MAXN];
int main() {
  long long int n;
  cin >> n;
  for (long long int i = 1; i <= n; i++) cin >> a[i];
  long long int q = 0;
  for (long long int i = 1; i <= n; i++) {
    q = min(q, a[i] - i);
    r[i] = q + i;
  }
  q = n + 1;
  for (long long int i = n; i > 0; i--) {
    q = min(q, a[i] + i);
    l[i] = q - i;
  }
  q = 0;
  for (long long int i = 1; i <= n; i++) q = max(q, min(l[i], r[i]));
  cout << q;
}
