#include <bits/stdc++.h>
using namespace std;
int i, z, n, m, j, maxi = 0, start, final, mini = 100000000, b, a, total = 1, k,
                   d, ok;
int dp[500005];
int v[500005];
long long int ans;
vector<int> r;
string t;
map<string, int> mymap;
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cout << fixed;
  cin >> n;
  b = 1;
  for (i = 1; i <= n; i++) {
    cin >> v[i];
    b = min(v[i], b);
    dp[i] = b;
    b++;
  }
  b = 1;
  for (i = n; i; i--) {
    b = min(v[i], b);
    dp[i] = min(dp[i], b);
    b++;
    maxi = max(maxi, dp[i]);
  }
  cout << maxi;
  return 0;
}
