#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
int a[maxn + 5], vis[maxn + 5];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) vis[i] = min(a[i], vis[i - 1] + 1);
  for (int i = n; i >= 1; i--) vis[i] = min(vis[i], min(a[i], vis[i + 1] + 1));
  int ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, vis[i]);
  printf("%d\n", ans);
}
