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