#include <bits/stdc++.h>
const int N = 1e5 + 5;
int dp[N][2];
int h[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", h + i);
  dp[0][0] = dp[n - 1][1] = 1;
  for (int i = 1; i < n; ++i) {
    dp[i][0] = std::min(h[i], dp[i - 1][0] + 1);
  }
  for (int i = n - 2; i >= 0; --i) {
    dp[i][1] = std::min(h[i], dp[i + 1][1] + 1);
  }
  int ans = INT_MIN;
  for (int i = 0; i < n; ++i) {
    ans = std::max(ans, std::min(dp[i][0], dp[i][1]));
  }
  printf("%d\n", ans);
  return 0;
}
