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