#include <bits/stdc++.h>
using namespace std;
const long long MAX = 100000 + 50;
int dp[MAX], n, h[MAX], maxa, b, t, f;
int main() {
  cin >> n;
  dp[0] = 1;
  dp[n - 1] = 1;
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  for (int i = 1; i < n - 1; i++) {
    dp[i] = min(h[i], dp[i - 1] + 1);
  }
  for (int i = n - 1; i >= 0; i--) {
    dp[i] = min(dp[i], dp[i + 1] + 1);
  }
  for (int i = 0; i < n; i++) {
    maxa = max(maxa, dp[i]);
  }
  cout << maxa;
}
