#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n + 2);
  for (long long i = 1; i < n + 1; i++) cin >> v[i];
  for (long long i = 1; i < n + 1; i++) {
    v[i] = min(v[i - 1] + 1, v[i]);
  }
  for (long long i = n; i > 0; i--) {
    v[i] = min(v[i + 1] + 1, v[i]);
  }
  long long ans = 0;
  for (long long i = 1; i < n + 1; i++) ans = max(ans, v[i]);
  cout << ans << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
