#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const long long LIM = 1e18;
const int INF = 0x3f3f3f3f;
const double eps = 1e-4;
const double PI = atan(1.0) * 4;
const int mod = 10007;
int n, h[N + 10];
int a[N + 10];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
  for (int i = 1; i <= n; i++) a[i] = min(h[i], a[i - 1] + 1);
  for (int i = n; i; i--) a[i] = min(a[i], a[i + 1] + 1);
  int ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, a[i]);
  cout << ans;
  return 0;
}
