#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
const int N = 2e5 + 5;
const ll INF = 1e18 + 1;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> v(n), req(n), req2(n);
  for (auto &&i : v) cin >> i;
  int ans = 0;
  int mx = 1;
  for (int i = 0; i < n; i++) {
    mx = min(mx, v[i]);
    req[i] = mx++;
  }
  mx = 1;
  for (int i = n - 1; i >= 0; i--) {
    mx = min(mx, v[i]);
    req2[i] = mx++;
    ans = max(ans, min(req2[i], req[i]));
  }
  cout << ans;
  return 0;
}
