#include <bits/stdc++.h>
long long power(long long base, long long exp) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base);
    base = (base * base);
    exp /= 2;
  }
  return res;
}
long long mod(long long a, long long b) { return (a % b + b) % b; }
long long powerm(long long base, long long exp, long long mod) {
  long long ans = 1;
  while (exp) {
    if (exp & 1) ans = (ans * base) % mod;
    exp >>= 1, base = (base * base) % mod;
  }
  return ans;
}
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long left[n], right[n];
  left[0] = 1;
  right[n - 1] = 1;
  for (long long i = 1; i < n; i++) {
    left[i] = min(arr[i], left[i - 1] + 1);
  }
  for (long long i = n - 2; i >= 0; i--) {
    right[i] = min(arr[i], right[i + 1] + 1);
  }
  long long ans = 1;
  for (long long i = 0; i < n; i++) {
    ans = max(ans, min(left[i], right[i]));
  }
  cout << ans << '\n';
  return 0;
}
