#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans[n + 1], ar[n + 1];
  for (int i = 1; i <= n; ++i) cin >> ar[i];
  for (int i = 1; i <= n; ++i) ans[i] = ar[i];
  ans[0] = ans[n + 1] = 0;
  for (int i = 1; i <= n; ++i)
    ans[i] = min(ans[i], min(ans[i - 1] + 1, ans[i + 1] + 1));
  for (int i = n; i >= 1; --i)
    ans[i] = min(ans[i], min(ans[i - 1] + 1, ans[i + 1] + 1));
  cout << *max_element(ans + 1, ans + n);
  return 0;
}
