#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
int sol, mmax, n, data[100010], dp[100010];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &data[i]);
  dp[0] = mmax = 1;
  for (int i = 1; i < n; ++i) {
    dp[i] = min(data[i], dp[i - 1] + 1);
    mmax = max(mmax, dp[i]);
  }
  dp[n - 1] = mmax = 1;
  for (int i = n - 2; i >= 0; --i) {
    dp[i] = min(dp[i], min(data[i], dp[i + 1] + 1));
    mmax = max(mmax, dp[i]);
  }
  for (int i = 0; i < n; ++i) sol = max(sol, dp[i]);
  printf("%d\n", sol);
}
