#include <bits/stdc++.h>
using namespace std;
int data[200000 + 10], dp[200000 + 10];
int main(int argc, char const *argv[]) {
  int n, t, ans, tans;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &dp[i]);
  }
  ans = -1;
  tans = -2;
  while (ans != tans) {
    t = 1;
    ans = tans;
    for (int i = 0; i < n; i++) {
      dp[i] = min(t, dp[i]);
      t = min(t, dp[i]);
      t++;
    }
    t = 1;
    for (int i = n - 1; i >= 0; i--) {
      dp[i] = min(t, dp[i]);
      t = min(t, dp[i]);
      t++;
    }
    for (int i = 0; i < n; i++) tans = max(tans, dp[i]);
  }
  printf("%d", ans);
  return 0;
}
