#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y) {
  long long int t;
  if (y == 0) return 1;
  t = power(x, y / 2);
  return (y % 2 == 0) ? t * t : x * t * t;
}
long long int powm(long long int a, long long int n, long long int mod) {
  long long int p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
long long int arr[100005], pr[100005], nx[100005];
int main() {
  int t, i, j;
  {
    memset(arr, (0), sizeof(arr));
    memset(pr, (0), sizeof(pr));
    memset(nx, (0), sizeof(nx));
    long long int temp, tallp = 0;
    long long int total = 0;
    int n;
    scanf("%d", &n);
    for ((i) = 0; (i) < (n); ++(i)) {
      scanf("%lld", &arr[i]);
      total += arr[i];
    }
    pr[0] = 1;
    for (i = (1); i <= (n - 1); ++i) {
      pr[i] = min(pr[i - 1] + 1, arr[i]);
    }
    nx[n - 1] = 1;
    for (int i = n - 2; i >= 0; i--) {
      nx[i] = min(nx[i + 1] + 1, arr[i]);
    }
    for ((i) = 0; (i) < (n); ++(i)) {
      temp = min(pr[i], nx[i]);
      tallp = max(tallp, temp);
    }
    printf("%lld\n", tallp);
  }
  return 0;
}
