#include <bits/stdc++.h>
const int N = 1e5 + 10;
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c;
  while (!isdigit(c = getchar())) f -= (c == '-') * 2;
  while (isdigit(c)) x = x * 10 + f * (c - 48), c = getchar();
  return x;
}
int n, ans, a[N], f[N];
int max(int x, int y) { return x > y ? x : y; }
int min(int x, int y) { return x < y ? x : y; }
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  for (int i = 1; i <= n; ++i) f[i] = min(f[i - 1] + 1, a[i]);
  for (int i = n; i; --i) f[i] = min(f[i], f[i + 1] + 1);
  for (int i = 1; i <= n; ++i) ans = max(ans, f[i]);
  printf("%d", ans);
  return 0;
}
