#include <bits/stdc++.h>
using namespace std;
long long int binpowmod(long long int a, long long int b, long long int m) {
  a %= m;
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
long long int binpow(long long int a, long long int b) {
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long int modInverse(long long int n, long long int p) {
  return binpowmod(n, p - 2, p);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, m, n, i, f = 0, j, ans = 0, l, r, k, t1, t2, x, y, cnt;
  cin >> n;
  vector<long long int> h(n);
  for (i = 0; i < n; ++i) cin >> h[i];
  vector<long long int> m1(n), m2(n);
  m1[0] = 1;
  m2[n - 1] = 1;
  for (i = 1; i < n; ++i) {
    m1[i] = std::min(m1[i - 1] + 1, h[i]);
    m2[n - i - 1] = std::min(m2[n - i] + 1, h[n - i - 1]);
  }
  for (i = 0; i < n; ++i) ans = std::max(ans, std::min(m1[i], m2[i]));
  cout << ans;
  return 0;
}
