#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 100009;
  int n, left[N], right[N], h[N];
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
  left[1] = 1;
  for (int i = 2; i <= n; i++) left[i] = min(h[i], left[i - 1] + 1);
  right[n] = 1;
  for (int i = n - 1; i >= 1; i--) right[i] = min(h[i], right[i + 1] + 1);
  int ans = -1;
  for (int i = 1; i <= n; i++) ans = max(ans, min(left[i], right[i]));
  cout << ans << endl;
  return 0;
}
