#include <bits/stdc++.h>
using namespace std;
int n, high[500007], l[500007], r[500007];
int max_possible() {
  for (int i = 1; i <= n; ++i) l[i] = r[i] = high[i];
  l[1] = 1;
  r[n] = 1;
  for (int i = 2; i <= n; ++i) {
    l[i] = min(l[i - 1] + 1, l[i]);
  }
  for (int i = n - 1; i >= 1; --i) {
    r[i] = min(r[i + 1] + 1, r[i]);
  }
  int ans = 1;
  for (int i = 1; i <= n; ++i) ans = max(min(r[i], l[i]), ans);
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> high[i];
  cout << max_possible() << "\n";
  return 0;
}
