#include <bits/stdc++.h>
typedef int* int_pointer;
using namespace std;
int main(void) {
  long long n;
  cin >> n;
  vector<long long> A(n);
  vector<long long> dp(n, 0);
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (int i = 1; i < n; i++) {
    dp[i] = min(A[i], dp[i - 1] + 1);
  }
  dp[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--) {
    dp[i] = min(dp[i], dp[i + 1] + 1);
  }
  long long answer = -1;
  for (int i = 0; i < n; i++) answer = max(answer, dp[i]);
  cout << answer << endl;
  return 0;
}
