#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  while (a > 0 && b > 0) {
    if (a > b)
      a %= b;
    else
      b %= a;
  }
  return (a + b);
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
bool prime(T n) {
  if (n <= 1) {
    return false;
  }
  T i = 2;
  while (i * i <= n) {
    if (n % i == 0) {
      return false;
    }
    ++i;
  }
  return true;
}
void solveTask() {
  int n;
  cin >> n;
  vector<int> a(n), l(n), r(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  l[0] = 1;
  for (int i = 1; i < n; ++i) {
    l[i] = l[i - 1] + 1;
    l[i] = min(l[i], a[i]);
  }
  r[n - 1] = 1;
  for (int i = n - 2; i >= 0; --i) {
    r[i] = r[i + 1] + 1;
    r[i] = min(r[i], a[i]);
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    ans = max(ans, min(l[i], r[i]));
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  solveTask();
  return 0;
}
