#include <bits/stdc++.h>
using namespace std;
int n;
int l[123456];
int r[123456];
int a[123456];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) l[i] = min(l[i - 1] + 1, a[i]);
  for (int i = n; i >= 1; i--) r[i] = min(r[i + 1] + 1, a[i]);
  int ans = 1;
  for (int i = 1; i <= n; i++) ans = max(ans, min(l[i], r[i]));
  cout << ans;
  return 0;
}
