#include <bits/stdc++.h>
using namespace std;
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
static long long gcd(long long a, long long b) {
  long long r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long lcm(long long a, long long b) {
  long long temp = gcd(a, b);
  return temp ? (a / temp * b) : 0;
}
unsigned long long PowMod(unsigned long long x, unsigned long long e,
                          unsigned long long mod) {
  unsigned long long res;
  if (e == 0) {
    res = 1;
  } else if (e == 1) {
    res = x;
  } else {
    res = PowMod(x, e / 2, mod);
    res = res * res % mod;
    if (e % 2) res = res * x % mod;
  }
  return res;
}
int BIT[100005];
void update(int x, int delta, int n) {
  for (; x <= n; x += x & -x) BIT[x] += delta;
}
int query(int x) {
  int sum = 0;
  for (; x > 0; x -= x & -x) sum += BIT[x];
  return sum;
}
int h[100005];
int leftmin[100005];
void solve() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
  leftmin[0] = 0;
  for (int i = 1; i <= n; i++) {
    leftmin[i] = min(h[i], leftmin[i - 1] + 1);
  }
  leftmin[n + 1] = 0;
  for (int i = n; i > 0; i--) {
    leftmin[i] = min(leftmin[i], leftmin[i + 1] + 1);
  }
  int ans = 1;
  for (int i = 1; i <= n; i++) ans = max(ans, leftmin[i]);
  cout << ans;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int q = 1; q <= t; q++) {
    solve();
  }
  return 0;
}
