#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  if (n == 1 || n == 2) {
    int x;
    for (int(i) = 0; (i) < (n); (i)++) cin >> x;
    cout << 1;
    return 0;
  }
  cin >> n;
  unsigned long long ar[100010];
  unsigned long long na[100010];
  for (int(i) = 0; (i) < (n); (i)++) {
    unsigned long long x;
    cin >> x;
    ar[i] = x;
  }
  na[0] = 1;
  na[n - 1] = 1;
  for (int i = 1; i < n - 1; i++) {
    if (ar[i] == 0)
      na[i] = 0;
    else if (ar[i] == 1)
      na[i] = 1;
    else if (i != 0) {
      if (na[i - 1] + 1 < ar[i])
        na[i] = na[i - 1] + 1;
      else
        na[i] = ar[i];
    }
  }
  for (int i = n - 1; i > 0; i--) {
    if (ar[i] == 0)
      na[i] = 0;
    else if (ar[i] == 1)
      na[i] = 1;
    else if (i != 0) {
      na[i] = min(na[i], ar[i]);
      na[i] = min(na[i], na[i + 1] + 1);
    }
  }
  int ans = 0;
  for (int(i) = 0; (i) < (n); (i)++) {
    if (ans < na[i]) ans = na[i];
  }
  cout << ans;
  return 0;
}
