#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e5 + 7;
const int Max = 4e3 + 7;
const int Mod = 1e9 + 7;
const int Inf = 1e9 + 7;
int n, ans, h[Maxn], dp[Maxn], dp1[Maxn];
int main() {
  ios_base::sync_with_stdio(false);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &h[i]);
  dp1[1] = 1;
  for (int i = 2; i <= n; i++) dp1[i] = min(dp1[i - 1] + 1, h[i]);
  dp[n] = 1;
  for (int i = n - 1; i > 0; i--) dp[i] = min(dp[i + 1] + 1, h[i]);
  for (int i = 0; i <= n; i++) ans = max(ans, min(dp1[i], dp[i]));
  printf("%d\n", ans);
  return 0;
}
