#include <bits/stdc++.h>
using namespace std;
vector<int> a, b;
int n;
int main() {
  cin >> n;
  a.resize(n);
  b.resize(n);
  b[0] = 1;
  b[n - 1] = 1;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n - 1; i++) b[i] = min(a[i], b[i - 1] + 1);
  for (int i = n - 2; i > 0; i--) b[i] = min(b[i], b[i + 1] + 1);
  int ans(0);
  for (int i = 0; i < n; i++) ans = max(ans, b[i]);
  cout << ans;
}
