#include <bits/stdc++.h>
using namespace std;
long long getInt() {
  long long ret;
  char tmpc;
  bool sign = 0;
  while (tmpc = getchar(), !isdigit(tmpc)) sign = (tmpc == '-');
  ret = tmpc - '0';
  while (tmpc = getchar(), isdigit(tmpc)) ret = ret * 10 + tmpc - '0';
  if (sign) ret *= -1;
  return ret;
}
const int mx = 1e5 + 10;
int n, ans, dp[2][mx];
int main() {
  n = getInt();
  vector<int> in(n + 2);
  for (int i = 1; i <= n; i++) {
    in[i] = getInt();
    dp[0][i] = min(in[i], dp[0][i - 1] + 1);
  }
  for (int i = n; i >= 1; i--) {
    dp[1][i] = min(in[i], dp[1][i + 1] + 1);
    ans = max(ans, min(dp[0][i], dp[1][i]));
  }
  printf("%d\n", ans);
  return 0;
}
