#include <bits/stdc++.h>
using namespace std;
const int NMAX = 100005;
const int INF = 1 << 30;
int v[NMAX], n, dp[NMAX];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> v[i];
  for (int i = 1; i <= n; ++i) dp[i] = INF;
  dp[1] = dp[n] = 1;
  for (int i = 2; i < n; ++i) dp[i] = min(dp[i], min(v[i], dp[i - 1] + 1));
  for (int i = n - 1; i > 1; --i) dp[i] = min(dp[i], dp[i + 1] + 1);
  int maxim = -1;
  for (int i = 1; i <= n; ++i) maxim = max(maxim, dp[i]);
  cout << maxim;
  return 0;
}
