#include <bits/stdc++.h>
using namespace std;
long h[100001], res[100001];
long n, m;
vector<long> d[4001];
int main() {
  cin >> n;
  long l = 1;
  long r = n;
  for (int i = 0; i < n; i++) cin >> h[i];
  res[0] = res[n - 1] = 1;
  for (int i = 1; i <= n - 2; i++) {
    res[i] = min(res[i - 1] + 1, h[i]);
    if (h[i] > h[i - 1]) res[i] = min(res[i], h[i - 1] + 1);
    if (h[i] > h[i + 1]) res[i] = min(res[i], h[i + 1] + 1);
  }
  for (int i = n - 2; i > 0; i--) {
    res[i] = min(res[i], res[i + 1] + 1);
    if (h[i] > h[i - 1]) res[i] = min(res[i], h[i - 1] + 1);
    if (h[i] > h[i + 1]) res[i] = min(res[i], h[i + 1] + 1);
  }
  long ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, res[i]);
  cout << ans;
  return 0;
}
