#include <bits/stdc++.h>
using namespace std;
int dp[2][100010];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < (n); i++) cin >> a[i];
  int ma = 0;
  dp[0][0] = 1;
  dp[1][n - 1] = 1;
  for (int i = 0; i < (n - 1); i++) {
    dp[0][i + 1] = min(dp[0][i] + 1, a[i + 1]);
  }
  for (int i = (n)-1; i >= (1); i--) {
    dp[1][i - 1] = min(dp[1][i] + 1, a[i - 1]);
  }
  for (int i = 0; i < (n); i++) {
    dp[0][i] = min(dp[0][i], dp[1][i]);
  }
  for (int i = 0; i < (n); i++) ma = max(ma, dp[0][i]);
  cout << ma << endl;
}
