#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long> dp(n + 1, 100000000000);
  vector<long long> rdp(n, 0);
  vector<long long> ldp(n, 0);
  rdp[n - 1] = 1;
  ldp[0] = 1;
  for (long long i = 1; i < n; i++) {
    ldp[i] = min(ldp[i - 1] + 1, a[i]);
  }
  for (long long i = n - 2; i >= 0; i--) {
    rdp[i] = min(rdp[i + 1] + 1, a[i]);
  }
  for (long long i = 0; i < n; i++) {
    dp[i] = min(min(ldp[i], rdp[i]), a[i]);
  }
  long long m = 0;
  for (long long i = 0; i < n; i++) {
    m = max(m, dp[i]);
  }
  cout << m << endl;
  return 0;
}
