#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  return b == 0 ? a : gcd(b, a % b);
}
template <typename T>
T LCM(T a, T b) {
  return a * (b / gcd(a, b));
}
template <typename T>
T expo(T b, T e, const T &m) {
  if (e <= 1) return e == 0 ? 1 : b;
  return (e & 1) == 0 ? expo((b * b) % m, e >> 1, m)
                      : (b * expo((b * b) % m, e >> 1, m)) % m;
}
template <typename T>
T modinv(T a) {
  return expo(a, 1000000007ll - 2, 1000000007ll);
}
template <class T, class second>
std::ostream &operator<<(std::ostream &os, const std::pair<T, second> &t) {
  os << "(" << t.first << ", " << t.second << ")";
  return os;
}
template <class T>
std::ostream &operator<<(std::ostream &os, const std::vector<T> &t) {
  os << "[";
  for (__typeof(t.begin()) it = t.begin(); it != t.end(); it++) {
    if (it != t.begin()) os << ", ";
    os << *it;
  }
  os << "]";
  return os;
}
int h[100002], n;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (__typeof(n) i = 0; i < n; i++) {
    cin >> h[i];
  }
  h[0] = 1;
  for (__typeof(n - 1) i = 1; i <= n - 1; i++) {
    h[i] = min(h[i - 1] + 1, h[i]);
  }
  h[n - 1] = 1;
  for (int i = n - 2; i > -1; i--) {
    h[i] = min(h[i + 1] + 1, h[i]);
  }
  int res = h[0];
  for (__typeof(n) i = 0; i < n; i++) {
    res = max(h[i], res);
  }
  cout << res << '\n';
  return 0;
}
