#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
void fail() {
  std::cout << "NO\n";
  exit(0);
}
using namespace std;
const long long N = 1e5 + 5;
long long a[N], dp[N], n;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (long long i = 0; i <= n + 1; i++) dp[i] = INT_MAX;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    dp[i] = min(i, a[i]);
    dp[i] = min(dp[i], dp[i - 1] + 1);
  }
  for (long long i = n; i >= 1; i--) {
    dp[i] = min(dp[i], n - i + 1);
    dp[i] = min(dp[i], dp[i + 1] + 1);
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    ans = max(ans, dp[i]);
  }
  cout << ans << '\n';
  return 0;
}
