#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
long long int a[N], dp[N][5], ans = 0, n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  dp[0][0] = 1, dp[n - 1][1] = 1;
  for (int i = 1; i < n; i++) dp[i][0] = min(dp[i - 1][0] + 1, a[i]);
  for (int i = n - 2; i >= 0; i--) dp[i][1] = min(dp[i + 1][1] + 1, a[i]);
  for (int i = 0; i < n; i++) ans = max(ans, min(dp[i][0], dp[i][1]));
  cout << ans;
}
