#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int inf = 1e9 + 100;
long long int a[maxn], dp[maxn], pd[maxn], maxi;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    if (i == 1)
      dp[i] = 1;
    else
      dp[i] = min(dp[i - 1] + 1, a[i]);
  }
  for (int i = n; i >= 1; i--) {
    if (i == n)
      pd[i] = 1;
    else
      pd[i] = min(pd[i + 1] + 1, a[i]);
  }
  for (int i = 1; i <= n; i++) maxi = max(maxi, min(dp[i], pd[i]));
  cout << maxi << endl;
}
