#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 19;
int l[maxn], r[maxn], a[maxn], ans, n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i < n + 1; i++) l[i] = min(l[i - 1] + 1, a[i]);
  for (int i = n; i > 0; --i) r[i] = min(r[i + 1] + 1, a[i]);
  for (int i = 1; i < n + 1; i++) ans = max(ans, min(l[i], r[i]));
  cout << ans << endl;
  return 0;
}
