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