#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 3000;
int n;
int h[maxn];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &h[i]);
  }
  for (int i = 0; i <= n + 1; i++) {
    for (int j = i - 1; j > 0; j--) {
      if (h[j] <= h[i] + i - j) break;
      h[j] = h[i] + i - j;
    }
    for (int j = i + 1; j <= n; j++) {
      if (h[j] <= h[i] + j - i) break;
      h[j] = h[i] + j - i;
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, h[i]);
  }
  cout << ans << endl;
  return 0;
}
