#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long n, a[100005], b[100005];
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    if (a[i - 1] >= a[i] && a[i + 1] >= a[i]) {
      b[i] = a[i];
      continue;
    }
    b[i] = min(a[i - 1], a[i + 1]) + 1;
  }
  long long lvl = 1, ans = 0;
  for (int i = 1; i <= n; i++) {
    b[i] = min(b[i], lvl);
    lvl = b[i];
    lvl++;
  }
  lvl = 1;
  for (int i = n; i > 0; i--) {
    b[i] = min(lvl, b[i]);
    lvl = b[i];
    lvl++;
    ans = max(ans, b[i]);
  }
  cout << ans << endl;
  return 0;
}
