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