#include <bits/stdc++.h>
using namespace std;
bool is_prime(int n) {
  for (int i = 2; i <= sqrt(n); i++) {
    if (!(n % i)) return false;
  }
  return true;
}
void solve(int index = 0) {
  int n;
  cin >> n;
  vector<int> v(n + 2, 0);
  int i = 0;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
  }
  vector<int> l(n + 2, 0);
  vector<int> r(n + 2, 0);
  for (int i = 1; i <= n; i++) {
    l[i] = min(l[i - 1] + 1, v[i]);
  }
  for (int i = n; i >= 1; i--) {
    r[i] = min(r[i + 1] + 1, v[i]);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, min(l[i], r[i]));
  }
  cout << ans << "\n";
}
void multi_solve() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve(i);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
