#include <bits/stdc++.h>
using namespace std;
int n;
int dp[100010][2];
int height[100010];
int main() {
  scanf("%d", &n);
  memset(dp, 0x3f3f3f3f, sizeof dp);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &height[i]);
  }
  height[0] = 0;
  height[n + 1] = 0;
  dp[0][0] = 0;
  dp[n + 1][1] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = min(dp[i][0], dp[i - 1][0] + 1);
    dp[i][0] = min(dp[i][0], height[i]);
  }
  for (int i = n; i >= 1; i--) {
    dp[i][1] = min(dp[i][1], dp[i + 1][1] + 1);
    dp[i][1] = min(dp[i][1], height[i]);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int tmp = min(dp[i][0], dp[i][1]);
    ans = max(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
