#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
int res[MAXN];
int a[MAXN];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      res[i] = a[i];
    }
    int now = 0;
    int pre = 0;
    for (int i = 1; i <= n; i++) {
      now = pre + 1;
      pre = res[i] = min(res[i], now);
    }
    pre = 0;
    for (int i = n; i >= 1; i--) {
      now = pre + 1;
      pre = res[i] = min(res[i], now);
    }
    int max1 = -1;
    for (int i = 1; i <= n; i++) max1 = max(max1, res[i]);
    printf("%d\n", max1);
  }
  return 0;
}
