#include <bits/stdc++.h>
using namespace std;
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T gcd(T a, T b) {
  T first;
  while (b != 0) {
    first = a % b;
    a = b;
    b = first;
  }
  return a;
}
const long double PI = 2 * acos(0.0);
const long double eps = 1e-15;
const int infi = 1e9;
const long long Linfi = 1e18;
const long long MOD = 1000000007;
const int c1 = 31;
const int c2 = 37;
int n;
int a[1000005], L[1000005], R[1000005];
void solve() {
  L[1] = 1;
  for (int i = 2; i <= n; i++) L[i] = min(L[i - 1] + 1, a[i]);
  R[n] = 1;
  for (int i = n - 1; i >= 1; i--) R[i] = min(R[i + 1] + 1, a[i]);
  int ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, min(L[i], R[i]));
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  solve();
  return 0;
}
