#include <bits/stdc++.h>
using namespace std;
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
bool isone(long long, int);
int count(long long);
long long exp(long long, long long, long long);
long long GCD(long long, long long);
int a[100010], b[100010], c[100010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  b[0] = 1;
  for (int i = 1; i < n; i++) b[i] = min(1 + b[i - 1], min(a[i], a[i - 1] + 1));
  c[n - 1] = 1;
  for (int i = n - 2; i >= 0; i--)
    c[i] = min(1 + c[i + 1], min(a[i], a[i + 1] + 1));
  int ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, min(b[i], c[i]));
  printf("%d", ans);
  return 0;
}
long long GCD(long long a, long long b) {
  if (!b)
    return a;
  else
    return GCD(b, a % b);
}
long long exp(long long a, long long b, long long c) {
  long long ret = 1LL;
  long long mult = a;
  while (b) {
    if (b & 1) ret = (ret * mult) % c;
    mult = (mult * mult) % c;
    b >>= 1;
  }
  return ret;
}
int count(long long x) {
  int ret = 0;
  while (x) {
    if (x & 1) ret++;
    x >>= 1LL;
  }
  return ret;
}
bool isone(long long x, int pos) { return x & (1 << pos); }
