#include <bits/stdc++.h>
using namespace std;
long long a[100001], l[100001], r[100001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long o = 0, i, n;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  l[0] = 1;
  for (i = 1; i < n; i++) l[i] = min(l[i - 1] + 1, a[i]);
  r[n - 1] = 1;
  for (i = n - 2; i >= 0; i--) r[i] = min(r[i + 1] + 1, a[i]);
  for (i = i; i < n; i++) o = max(o, min(l[i], r[i]));
  cout << o << '\n';
}
