#include <bits/stdc++.h>
using namespace std;
int l[100005], r[100005];
int h[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
  r[n] = 1;
  for (int i = n - 1; i >= 1; i--) r[i] = min(h[i], r[i + 1] + 1);
  l[1] = 1;
  for (int i = 2; i <= n; i++) l[i] = min(h[i], l[i - 1] + 1);
  int ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, min(l[i], r[i]));
  cout << ans << "\n";
  return 0;
}
