#include <bits/stdc++.h>
using namespace std;
const long long mx = 100009;
int ara[mx];
int l[mx], r[mx];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> ara[i];
  l[1] = 1;
  for (int i = 2; i <= n; i++) l[i] = min(ara[i], l[i - 1] + 1);
  r[n] = 1;
  for (int i = n - 1; i >= 1; i--) r[i] = min(ara[i], r[i + 1] + 1);
  int ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, min(l[i], r[i]));
  cout << ans << '\n';
}
