#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, h[100001];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &h[i]);
  int min_time[100001] = {
      0,
      0,
  };
  for (int i = 1; i < n; i++)
    min_time[i] =
        (min_time[i - 1] + 1 < h[i] - 1 ? (min_time[i - 1] + 1) : (h[i] - 1));
  min_time[n - 1] = 0;
  for (int i = n - 1; i > 0; i--)
    min_time[i] =
        (min_time[i] < (min_time[i + 1] + 1 < h[i] - 1 ? (min_time[i + 1] + 1)
                                                       : (h[i] - 1))
             ? (min_time[i])
             : ((min_time[i + 1] + 1 < h[i] - 1 ? (min_time[i + 1] + 1)
                                                : (h[i] - 1))));
  int ans = 0;
  for (int i = 0; i < n; i++) ans = (ans > min_time[i] ? (ans) : (min_time[i]));
  printf("%d\n", ans + 1);
  return 0;
}
