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