#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
double eps = 1e-10;
using namespace std;
int n, a[100005], ans = 0, d[100005];
vector<pair<int, int> > g[100005];
bool used[100005];
set<pair<int, int> > s;
void dijkstra() {
  while (!s.empty()) {
    int v = s.begin()->second;
    ans = (ans > d[v] ? ans : d[v]);
    s.erase(s.begin());
    for (int i = 0; i < g[v].size(); i++) {
      int to = g[v][i].first, len = g[v][i].second;
      if (d[v] + len < d[to]) {
        s.erase({d[to], to});
        d[to] = d[v] + len;
        s.insert({d[to], to});
      }
    }
  }
}
int main() {
  cin >> n;
  s.insert({0, 0});
  for (int i = 1; i <= n; i++) {
    d[i] = 2000000000;
    scanf("%d", &a[i]);
    int mn = 2000000000;
    mn = (mn < i ? mn : i);
    mn = (mn < n - i + 1 ? mn : n - i + 1);
    mn = (mn < a[i] ? mn : a[i]);
    g[0].push_back({i, mn});
    g[i].push_back({0, mn});
    if (i != 1) {
      g[i].push_back({i - 1, 1});
      g[i - 1].push_back({i, 1});
    }
  }
  dijkstra();
  cout << ans << endl;
}
