#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10, inf = 1e9 + 10;
int a[MAXN];
int main() {
  ios::sync_with_stdio(false);
  int n, Max = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) a[i] = min(a[i], min(a[i - 1], a[i + 1]) + 1);
  for (int i = n; i > 0; i--) {
    a[i] = min(a[i], min(a[i - 1], a[i + 1]) + 1);
    Max = max(Max, a[i]);
  }
  cout << Max << endl;
  return 0;
}
