#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e+5 + 100;
const int INF = numeric_limits<int>::max();
const long long LL_INF = numeric_limits<long long>::max();
int A[MAXN], n;
int dl[MAXN], dr[MAXN];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
    dl[0] = 0;
    for (int i = 1; i <= n; i++) dl[i] = min(dl[i - 1] + 1, A[i]);
    dr[n + 1] = 0;
    for (int i = n; i >= 1; i--) dr[i] = min(dr[i + 1] + 1, A[i]);
    int ans = 0;
    for (int i = 1; i <= n; i++) ans = max(ans, min(dl[i], dr[i]));
    printf("%d\n", ans);
  }
  return 0;
}
