#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a;
  cin >> a;
  vector<long long> caja(a);
  for (long long i = 0; i < a; i++) cin >> caja[i];
  if (a == 1) {
    cout << 1;
    return 0;
  }
  caja[0] = 1;
  for (long long i = 1; i < a; i++) {
    if (caja[i] > caja[i - 1] + 1) caja[i] = caja[i - 1] + 1;
  }
  caja[a - 1] = 1;
  for (long long i = a - 1; i >= 0; i--) {
    if (caja[i] > caja[i + 1] + 1) caja[i] = caja[i + 1] + 1;
  }
  long long ma = 0;
  for (long long i = 0; i < a; i++)
    if (caja[i] > ma) ma = caja[i];
  cout << ma;
  return 0;
}
