#include <bits/stdc++.h>
using namespace std;
const int MAX = 100007;
int h[MAX];
int dp[MAX];
bool vis[MAX];
int main() {
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; ++i) {
      cin >> h[i];
      dp[i] = h[i];
    }
    dp[0] = dp[n - 1] = 1;
    for (int i = 1; i < n - 1; ++i) {
      dp[i] = min(dp[i - 1] + 1, h[i]);
    }
    int mx = 1;
    for (int i = n - 2; ~i; --i) {
      mx = max(mx, min(dp[i], dp[i + 1] + 1));
      dp[i] = min(dp[i + 1] + 1, h[i]);
    }
    cout << mx << endl;
  }
  return 0;
}
