#include <bits/stdc++.h>
using namespace std;
int n, h[500100], ans[500100];
void setup() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
}
void xuly() {
  int wo = 0;
  for (int i = 1; i <= n; i++) {
    wo = min(wo, h[i] - i);
    ans[i] = wo + i;
  }
  wo = n + 1;
  for (int i = n; i >= 1; i--) {
    wo = min(wo, h[i] + i);
    ans[i] = min(ans[i], wo - i);
  }
  int re = 0;
  for (int i = 1; i <= n; i++) re = max(re, ans[i]);
  cout << re;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  setup();
  xuly();
  return 0;
}
