#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 9;
long long n;
long long l[123456];
long long r[123456];
long long a[123456];
void solve() {
  cin >> n;
  for (int i = (1), _b = (n); i <= _b; i++) cin >> a[i];
  for (int i = (1), _b = (n); i <= _b; i++) l[i] = min(l[i - 1] + 1, a[i]);
  for (int i = (n), _b = (1); i >= _b; i--) r[i] = min(r[i + 1] + 1, a[i]);
  long long ans = 1;
  for (int i = (1), _b = (n); i <= _b; i++) ans = max(ans, min(l[i], r[i]));
  cout << ans;
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
