#include <bits/stdc++.h>
using namespace std;
long long n, h[100005];
class segment {
 public:
  long long t[500005];
  void build(int idx, int l, int r) {
    if (l >= r) return;
    if (r - l == 1) {
      t[idx] = h[l];
      return;
    }
    build(idx * 2, l, (l + r) / 2);
    build(idx * 2 + 1, (l + r) / 2, r);
    t[idx] = min(t[idx * 2], t[idx * 2 + 1]);
  }
  long long query(int idx, int l, int r, int a, int b) {
    if (b <= l || a >= r) return INFINITY;
    if (l >= a && r <= b) return t[idx];
    long long x, y;
    x = query(idx * 2, l, (l + r) / 2, a, b);
    y = query(idx * 2 + 1, (l + r) / 2, r, a, b);
    return min(x, y);
  }
} st;
long long dpl[100005], dpr[100005], dp[100005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> h[i];
  }
  dpl[1] = 1;
  dpl[n] = 1;
  for (int i = 2; i < n; i++) {
    dpl[i] = min(h[i - 1], dpl[i - 1]) + 1;
  }
  dpl[1] = 1;
  dpr[n] = 1;
  for (int i = n - 1; i > 1; i--) {
    dpr[i] = min(h[i + 1], dpr[i + 1]) + 1;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    dp[i] = min(h[i], min(dpl[i], dpr[i]));
    if (i == 1) ans = dp[i];
    ans = max(ans, dp[i]);
  }
  cout << ans << endl;
  return 0;
}
