#include <bits/stdc++.h>
using namespace std;
long long Set(long long n, long long pos) { return n = n | (1LL << pos); }
long long reset(long long n, long long pos) { return n = n & ~(1LL << pos); }
bool check(long long n, long long pos) { return (bool)(n & (1LL << pos)); }
long long mul(long long a, long long b) {
  long long c;
  c = (a % 1000000007 * b % 1000000007) % 1000000007;
  return c;
}
long long add(long long a, long long b) {
  long long c;
  c = (a % 1000000007 + b % 1000000007) % 1000000007;
  return c;
}
long long sub(long long a, long long b) {
  long long c;
  c = ((a % 1000000007 - b % 1000000007) % 1000000007 + 1000000007) %
      1000000007;
  return c;
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long exgcd(long long x, long long y, long long &a, long long &b) {
  int flag = 0;
  long long t, la = 1, lb = 0, ra = 0, rb = 1;
  while (x % y) {
    if (flag == 0)
      la -= x / y * ra, lb -= x / y * rb;
    else
      ra -= x / y * la, rb -= x / y * lb;
    t = x, x = y, y = t % y;
    flag = 1 - flag;
  }
  if (flag == 0)
    a = ra, b = rb;
  else
    a = la, b = lb;
  return y;
}
long long n, h[100005];
long long dp1[100005];
long long dp2[100005];
long long dp[100005];
int main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &h[i]);
  }
  dp1[0] = 0;
  dp2[n + 1] = 0;
  for (long long i = 1; i <= n; i++) {
    dp1[i] = min(dp1[i - 1] + 1, h[i]);
  }
  for (long long i = n; i >= 1; i--) {
    dp2[i] = min(dp2[i + 1] + 1, h[i]);
  }
  long long maxi = -1;
  for (long long i = 1; i <= n; i++) {
    dp[i] = min(dp1[i], dp2[i]);
    maxi = max(maxi, dp[i]);
  }
  cout << maxi << endl;
  return 0;
}
