#include <bits/stdc++.h>
using namespace std;
long long t[100010], l, r, i, n, p, pr, q, k;
int main() {
  cin >> n;
  r = n;
  for (i = 1; i <= n; i++) {
    cin >> t[i];
  }
  for (i = 1; i <= n; i++)
    t[i] = min(n - i + 1, min(i, min(t[i], min(t[i - 1] + 1, t[i + 1] + 1))));
  for (i = n; i >= 1; i--)
    t[i] = min(n - i + 1, min(i, min(t[i], min(t[i - 1] + 1, t[i + 1] + 1))));
  for (i = 1; i <= n; i++) k = max(k, t[i]);
  cout << k;
}
