#include <bits/stdc++.h>
using namespace std;
long long arr[100001];
long long dp[100001], ht[100001];
int main() {
  long long ans = 0, i, j, ele, n, a, b, lima, maxi, m, temp;
  cin >> n;
  for (i = 0; i < n; i++) cin >> ht[i];
  dp[0] = 1;
  for (i = 1; i < n; i++) {
    dp[i] = min(dp[i - 1] + 1, ht[i]);
  }
  dp[n - 1] = 1;
  for (i = n - 2; i >= 0; i--) {
    dp[i] = min(dp[i], dp[i + 1] + 1);
  }
  maxi = 0;
  for (i = 0; i < n; i++) maxi = max(maxi, dp[i]);
  cout << maxi;
}
