#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[100500], l[100500], r[100500];
  while (cin >> n) {
    int i;
    for (i = 1; i <= n; i++) cin >> a[i];
    l[1] = 1;
    for (i = 2; i <= n; i++)
      if (a[i] > l[i - 1])
        l[i] = l[i - 1] + 1;
      else
        l[i] = min(l[i - 1], a[i]);
    r[n] = 1;
    for (i = n - 1; i >= 1; i--)
      if (a[i] > r[i + 1])
        r[i] = r[i + 1] + 1;
      else
        r[i] = min(l[i + 1], a[i]);
    for (i = 1; i <= n; i++) l[i] = min(l[i], r[i]);
    int ans = -1;
    for (i = 1; i <= n; i++) ans = max(ans, l[i]);
    cout << ans << endl;
  }
}
