#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int dr8[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dc8[] = {1, -1, 0, 0, -1, 1, -1, 1};
int dr[] = {0, 1, -1, 0};
int dc[] = {1, 0, 0, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++) cin >> a[i];
  int fr[n + 1], rv[n + 1], prev = 0;
  fr[0] = fr[n + 1] = rv[0] = rv[n + 1] = 0;
  for (int i = 1; i <= n; i++) fr[i] = min(fr[i - 1] + 1, a[i]);
  for (int i = n; i >= 1; i--) rv[i] = min(rv[i + 1] + 1, a[i]);
  int ans = 1;
  for (int i = 1; i <= n; i++) ans = max(ans, min(fr[i], rv[i]));
  cout << ans;
}
