#include <bits/stdc++.h>
using namespace std;
int h[100005], tf[100005], tb[100005];
int main() {
  int(n);
  scanf("%d", &(n));
  for (int i = 0; i < n; i++) {
    scanf("%d", &h[i]);
    tf[i] = tb[i] = 1000000007;
  }
  tf[0] = 1;
  for (int i = 1; i < n; i++) {
    if (h[i] == 1)
      tf[i] = 1;
    else
      tf[i] = min(tf[i - 1] + 1, h[i]);
  }
  tb[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--) {
    if (h[i] == 1)
      tb[i] = 1;
    else
      tb[i] = min(tb[i + 1] + 1, h[i]);
  }
  int ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, min(tf[i], tb[i]));
  cout << ans << "\n";
  return 0;
}
