#include <bits/stdc++.h>
using namespace std;
long long dp[1001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long h[n];
  for (long long i = 0; i < n; i++) cin >> h[i];
  long long ans[n + 2];
  long long finalans = -1;
  ans[0] = 0;
  ans[n + 1] = 0;
  for (long long i = 1; i < n + 1; i++) ans[i] = min(ans[i - 1] + 1, h[i - 1]);
  for (long long i = n; i > 0; i--) {
    ans[i] = min(ans[i], ans[i + 1] + 1);
    finalans = max(finalans, ans[i]);
  }
  cout << finalans;
  return 0;
}
