#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
const int INF = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
int a[111114], l[111111], r[111111];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    l[i] = min(a[i], l[i - 1] + 1);
  }
  for (int i = n; i >= 1; i--) {
    r[i] = min(a[i], r[i + 1] + 1);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, min(r[i], l[i]));
  }
  cout << ans << endl;
  return 0;
}
