#include <bits/stdc++.h>
using namespace std;
const long long mx = 1e5 + 5;
long long ans = -1;
long long l[mx];
long long r[mx];
long long ht[mx];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n, i;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> ht[i];
  for (i = 1; i <= n; i++) l[i] = min(l[i - 1] + 1, ht[i]);
  for (i = n; i >= 1; i--) r[i] = min(r[i + 1] + 1, ht[i]);
  for (i = 1; i <= n; i++) ans = max(ans, min(l[i], r[i]));
  cout << ans << "\n";
  return 0;
}
