#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, h[100005];
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
  vector<int> res(n + 5), izq(n + 5), der(n + 5);
  for (int i = 1; i <= n; i++) res[i] = izq[i] = min(h[i], izq[i - 1] + 1);
  for (int i = n; i >= 1; i--)
    res[i] = min(res[i], (der[i] = min(h[i], der[i + 1] + 1)));
  cout << *max_element(res.begin(), res.end()) << '\n';
  return 0;
}
