#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
int a[MAX];
int dpl[MAX], dpr[MAX];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  dpl[0] = 0;
  dpr[n + 1] = 0;
  for (int i = 1; i <= n; i++) dpl[i] = min(dpl[i - 1] + 1, a[i]);
  for (int i = n; i >= 1; i--) dpr[i] = min(dpr[i + 1] + 1, a[i]);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, min(dpl[i], dpr[i]));
  }
  cout << ans << endl;
  return 0;
}
