#include <bits/stdc++.h>
using namespace std;
long long l[100005], r[100005];
int main() {
  int n;
  cin >> n;
  long long a[n + 3];
  for (int i = 1; i < n + 1; i++) {
    scanf("%lld", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    l[i] = min(l[i - 1] + 1, a[i]);
  }
  for (int i = n; i > 0; i--) {
    r[i] = min(r[i + 1] + 1, a[i]);
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, min(l[i], r[i]));
  cout << ans << endl;
  return 0;
}
