#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
int n, mn, out;
int h[200500], ans[200500];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d", &h[i]), ans[i] = min(h[i], min(i, n - i + 1));
  mn = inf;
  for (int i = 1; i <= n; i++) {
    ans[i] = min(ans[i], mn + i);
    mn = min(mn, h[i] - i);
  }
  mn = inf;
  for (int i = n; i >= 1; i--) {
    ans[i] = min(ans[i], mn - i);
    mn = min(mn, h[i] + i);
  }
  for (int i = 1; i <= n; i++) out = max(out, ans[i]);
  cout << out << endl;
  return 0;
}
