#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const double eps = 1e-15;
const long long INF = (1LL << 60);
const int N = 100010;
int Arr[N];
int main() {
  int n;
  scanf("%d", &n);
  Arr[0] = Arr[n + 1] = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &Arr[i]);
  }
  for (int i = 1; i <= n; ++i) {
    Arr[i] = min(Arr[i], Arr[i - 1] + 1);
  }
  for (int i = n; i >= 1; --i) {
    Arr[i] = min(Arr[i], Arr[i + 1] + 1);
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans = max(ans, Arr[i]);
  }
  printf("%d\n", ans);
  return 0;
}
