#include <bits/stdc++.h>
using namespace std;
void swap(int &a, int &b) {
  int c = a;
  a = b;
  b = c;
}
int nod(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> h(n);
  for (int i = 0; i < n; ++i) scanf("%d", &h[i]);
  vector<int> left(n, 1), right(n, 1);
  for (int i = 1; i < n; ++i) left[i] = min(left[i - 1] + 1, h[i]);
  for (int i = n - 2; i >= 0; --i) right[i] = min(right[i + 1] + 1, h[i]);
  int ans = 1;
  for (int i = 0; i < n; ++i) ans = max(ans, min(left[i], right[i]));
  cout << ans;
  return 0;
}
