#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long A[N], dl[N], dr[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> A[i];
  for (int i = 1; i <= n; i++) dl[i] = min(A[i], dl[i - 1] + 1);
  long long ans = 0;
  for (int i = n; i > 0; i--) {
    dr[i] = min(A[i], dr[i + 1] + 1);
    ans = max(ans, min(dl[i], dr[i]));
  }
  cout << ans;
  return 0;
}
