#include <bits/stdc++.h>
using namespace std;
int a[123456], le[123456], ri[123456];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  int o = 1;
  for (int i = 0; i < n; ++i) {
    o = min(o, a[i]);
    le[i] = o++;
  }
  o = 1;
  int ans = 0;
  for (int i = n - 1; i >= 0; --i) {
    o = min(o, a[i]);
    ri[i] = o++;
    ans = max(ans, min(le[i], ri[i]));
  }
  printf("%d\n", ans);
  return 0;
}
