#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int mn = 0, h[n + 1], ans[n + 1];
  for (long long int i = 1; i <= n; i++) cin >> h[i];
  for (long long int i = 1; i <= n; i++) {
    mn = min(mn, h[i] - i);
    ans[i] = i + mn;
  }
  mn = n + 1;
  for (long long int i = n; i >= 1; i--) {
    mn = min(mn, h[i] + i);
    ans[i] = min(ans[i], mn - i);
  }
  long long int mx = ans[1];
  for (long long int i = 1; i <= n; i++) {
    mx = max(ans[i], mx);
  }
  cout << mx;
  return 0;
}
