#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 + 100;
int dis[maxn];
int main() {
  int n;
  cin >> n;
  int h[n];
  for (int i = 0; i < n; i++) cin >> h[i];
  dis[0] = 1;
  dis[n - 1] = 1;
  for (int i = 1; i < n - 1; i++) dis[i] = min(dis[i - 1] + 1, h[i]);
  for (int i = n - 2; i > 0; i--) dis[i] = min(dis[i + 1] + 1, dis[i]);
  sort(dis, dis + n);
  cout << dis[n - 1];
  return 0;
}
