#include <bits/stdc++.h>
using namespace std;
int h[100009];
int dp[100009];
int main() {
  int n;
  cin >> n;
  int ans = -1;
  for (int i = 1; i <= n; i++) {
    cin >> h[i];
  }
  for (int i = 1; i <= n; i++) {
    dp[i] = min(h[i], dp[i - 1] + 1);
  }
  for (int i = n; i >= 1; i--) {
    dp[i] = min(dp[i], dp[i + 1] + 1);
    ans = max(ans, dp[i]);
  }
  cout << ans;
  return 0;
}
