#include <bits/stdc++.h>
using namespace std;
void gt(int &a, int b) {
  if (a < b) a = b;
}
string n2s(int a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
string getKey(int v, int h) { return n2s(v) + "-" + n2s(h); }
int h[500005]{0}, l[500005]{0}, r[500005]{0};
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
  l[1] = 1, r[n] = 1;
  for (int i = 2; i <= n; i++) l[i] = min(l[i - 1] + 1, h[i]);
  for (int i = n - 1; i >= 1; i--) r[i] = min(r[i + 1] + 1, h[i]);
  int ans = 1;
  for (int i = 1; i <= n; i++) ans = max(ans, min(l[i], r[i]));
  cout << ans << endl;
  return 0;
}
