#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
const int M = 1e9 + 7;
int h[maxn];
int l[maxn], r[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> h[i];
  l[0] = r[n - 1] = 1;
  int ans = 0;
  for (int i = 1; i < n; i++) {
    l[i] = min(l[i - 1] + 1, h[i]);
  }
  for (int i = n - 2; i > -1; i--) {
    r[i] = min(r[i + 1] + 1, h[i]);
  }
  for (int i = 0; i < n; i++) {
    ans = max(ans, min(l[i], r[i]));
  }
  cout << ans << endl;
  return 0;
}
