#include <bits/stdc++.h>
using namespace std;
const long long A = 100000000000000LL, N = 228228;
long long o[N], ot, i, j, n, m, a[N];
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]), o[i] = a[i];
  for (i = 1; i <= n; i++) {
    o[i] = min(o[i], o[i - 1] + 1);
  }
  for (i = n; i >= 1; i--) {
    o[i] = min(o[i], o[i + 1] + 1);
  }
  for (i = 1; i <= n; i++) ot = max(ot, o[i]);
  cout << ot << "\n";
}
