#include <bits/stdc++.h>
using namespace std;
long long mini(long long a, long long b) { return (a < b) ? a : b; }
long long maxi(long long a, long long b) { return (a > b) ? a : b; }
int main() {
  long long n, a, b = 0, c = 0;
  cin >> n;
  long long h[n];
  long long r[n];
  long long l[n];
  for (a = 0; a < n; a++) cin >> h[a];
  l[0] = 1;
  for (a = 1; a < n; a++) {
    l[a] = mini(l[a - 1] + 1, h[a]);
  }
  r[n - 1] = 1;
  for (a = n - 2; a >= 0; a--) {
    r[a] = mini(r[a + 1] + 1, h[a]);
  }
  for (a = 0; a < n; a++) {
    if (b < mini(l[a], r[a])) b = mini(l[a], r[a]);
  }
  cout << b;
}
