#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &x : a) cin >> x;
  int ans = n;
  vector<int> d = a;
  d[0] = 1;
  for (int i = 1; i < n; ++i) {
    d[i] = min(d[i], d[i - 1] + 1);
  }
  d[n - 1] = 1;
  for (int i = n - 2; i >= 0; --i) {
    d[i] = min(d[i], d[i + 1] + 1);
  }
  ans = 0;
  for (int i = 0; i < n; ++i) {
    ans = max(ans, d[i]);
  }
  ans = min(ans, n);
  cout << ans << endl;
}
