#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int dp[n];
  for (int i = 1; i < n - 1; i++) {
    dp[i] = 1000000000;
  }
  dp[0] = 1;
  dp[n - 1] = 1;
  for (int i = 1; i < n; i++) {
    if (arr[i] < arr[i - 1]) {
      dp[i] = min(dp[i], arr[i]);
      dp[i] = min(dp[i], dp[i - 1] + 1);
    } else {
      dp[i] = min(dp[i], dp[i - 1] + 1);
      dp[i] = min(dp[i], arr[i]);
    }
  }
  for (int i = n - 2; i >= 1; i--) {
    if (arr[i] < arr[i + 1]) {
      dp[i] = min(dp[i], arr[i]);
      dp[i] = min(dp[i], dp[i + 1] + 1);
    } else {
      dp[i] = min(dp[i], dp[i + 1] + 1);
      dp[i] = min(dp[i], arr[i]);
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans = max(ans, dp[i]);
  }
  cout << ans;
  return 0;
}
