#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int x;
  int a[N + 5];
  int b[N + 5];
  for (int n = 0; n < N; ++n) {
    scanf("%d", &a[n]);
    b[n] = a[n];
  }
  a[N] = 0;
  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  b[0] = 1;
  b[N - 1] = 1;
  int Ans = 0;
  int Count = 0;
  while (true) {
    bool flag = false;
    for (int n = 0; n < N; ++n) {
      if (n == 0) {
        b[n] = 1;
      } else if (n == N - 1) {
        b[n] = 1;
      } else {
        if (a[n] == 1) {
          b[n] = 1;
        } else {
          if (b[n] > (min(b[n - 1], b[n + 1]) + 1)) {
            b[n] = min(b[n - 1], b[n + 1]) + 1;
            flag = true;
          }
        }
      }
    }
    for (int n = N - 1; n >= 0; --n) {
      if (n == 0) {
        b[n] = 1;
      } else if (n == N - 1) {
        b[n] = 1;
      } else {
        if (a[n] == 1) {
          b[n] = 1;
        } else {
          if (b[n] > (min(b[n - 1], b[n + 1]) + 1)) {
            b[n] = min(b[n - 1], b[n + 1]) + 1;
            flag = true;
          }
        }
      }
    }
    if (flag == false) {
      break;
    }
    Count++;
  }
  for (int n = 0; n < N; ++n) {
    Ans = max(Ans, b[n]);
  }
  cout << Ans << endl;
  return 0;
}
