#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000000 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  int best = 1;
  vector<int> right(n), left(n);
  for (int i = 0; i < n; i++) {
    best = min(best, arr[i]);
    left[i] = best;
    best++;
  }
  best = 1;
  for (int i = n - 1; i >= 0; i--) {
    best = min(best, arr[i]);
    right[i] = best;
    best++;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, min(left[i], right[i]));
  cout << ans << endl;
  return 0;
}
