#include <bits/stdc++.h>
using namespace std;
int arr[112345];
int mn[112345];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &arr[i]);
  for (int i = 0; i <= n + 1; i++) mn[i] = 9999999;
  for (int i = 1; i <= n; i++) {
    mn[i] = min(mn[i - 1] + 1, arr[i]);
    mn[i] = min(i, mn[i]);
  }
  for (int i = n, j = 1; i >= 1; i--, j++) {
    mn[i] = min(mn[i], j);
    mn[i] = min(mn[i], mn[i + 1] + 1);
  }
  int ans = -1;
  for (int i = 1; i <= n; i++) ans = max(ans, mn[i]);
  cout << ans << endl;
  return 0;
}
