#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dx[] = {-1, 0, 1, 0};
long long dy[] = {0, -1, 0, 1};
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  vector<long long> pre(n), suf(n);
  pre[0] = suf[n - 1] = 1;
  for (long long i = 1; i < n; i++) {
    pre[i] = min(pre[i - 1] + 1, v[i]);
  }
  for (long long i = n - 2; i >= 0; i--) {
    suf[i] = min(suf[i + 1] + 1, v[i]);
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    ans = max(ans, min(pre[i], suf[i]));
  }
  cout << ans << "\n";
}
