#include <bits/stdc++.h>   using namespace std;   int main() {     int n, ans = -1;     cin >> n;     int a[n], l[n], r[n];     for (int i = 0; i < n; ++i) cin >> a[i];     for (int i = 0, des = 0; i < n; ++i) {       ++des;       l[i] = des = min(des, a[i]);     }     for (int i = n - 1, des = 0; i >= 0; --i) {       ++des;       r[i] = des = min(des, a[i]);     }     for (int i = 0; i < n; ++i) ans = max(ans, min(l[i], r[i]));     cout << ans << endl;   }   