Limak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is made of hi identical blocks. For clarification see picture for the first sample.

Limak will repeat the following operation till everything is destroyed.

Block is called internal if it has all four neighbors, i.e. it has each side (top, left, down and right) adjacent to other block or to the floor. Otherwise, block is boundary. In one operation Limak destroys all boundary blocks. His paws are very fast and he destroys all those blocks at the same time.

Limak is ready to start. You task is to count how many operations will it take him to destroy all towers.

Input

The first line contains single integer n (1 ≤ n ≤ 105).

The second line contains n space-separated integers h1, h2, ..., hn (1 ≤ hi ≤ 109) — sizes of towers.

Output

Print the number of operations needed to destroy all towers.

Examples

Input

6
2 1 4 6 2 2


Output

3


Input

7
3 3 3 1 3 3 3


Output

2

Note

The picture below shows all three operations for the first sample test. Each time boundary blocks are marked with red color. 

<image> After first operation there are four blocks left and only one remains after second operation. This last block is destroyed in third operation.
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class a {
	public static class node implements Comparable<node> {
		int x;
		int freq;

		node(int x, int freq) {
			this.x = x;
			this.freq = freq;
		}

		@Override
		public int compareTo(node o) {
			if (o.x < x)
				return 1;
			else if (o.x > x)
				return -1;
			else if (o.freq > freq)
				return 1;
			else if (o.freq < freq)
				return -1;
			return 0;
		}

	}

	public static class point {
		int x;
		int y;

		point(int x, int val) {
			this.x = x;
			this.y = val;
		}

	}

	public static long gcd(long a, long b) {
		if (b == 0)
			return a;
		return gcd(b, a % b);
	}

	public static ArrayList<Integer> prime;

	public static void sieve(int n) {
		boolean vis[] = new boolean[n + 5];
		vis[1] = true;
		vis[0] = true;
		for (int i = 2; i <= n; i++) {
			if (!vis[i]) {
				prime.add(i);
				for (long j = (long) i * (long) i; j <= n; j += i) {
					vis[(int) j] = true;
				}
			}
		}
	}

	public static int tree[][];
	public static boolean end[][];
	public static int counter;

	public static void trie(String a) {
		int st = 0;

		for (int i = 0; i < a.length(); i++) {
			if (tree[a.charAt(i) - 'a'][st] == 0) {
				tree[a.charAt(i) - 'a'][st] = counter++;
			}

			st = tree[a.charAt(i) - 'a'][st];
		}
		end[a.charAt(a.length() - 1) - 'a'][st] = true;

	}

	public static int seg[][];
	public static int a[][];
	public static int m;

	public static void build(int s, int e, int p) {
		if (s == e) {
			for (int i = 0; i < m; i++) {
				// System.out.println(p+" "+s);
				seg[i][p] = a[i][s];
			}
			return;
		}
		int mid = (s + e) / 2;
		build(s, mid, p * 2);
		build(mid + 1, e, p * 2 + 1);
		for (int i = 0; i < m; i++) {
			seg[i][p] = Math.max(seg[i][p * 2], seg[i][p * 2 + 1]);
		}
	}

	public static int get(int s, int e, int p, int from, int to, int seg[]) {
		if (s >= from && e <= to)
			return seg[p];
		if (s > to || e < from)
			return 0;
		int mid = (s + e) / 2;
		int one = get(s, mid, p * 2, from, to, seg);
		int two = get(mid + 1, e, p * 2 + 1, from, to, seg);
		return Math.max(one, two);
	}

	public static long comp(int n, int r) {
		long ans = 1;
		r = Math.min(r, n - r);
		for (int i = 1; i <= r; i++) {
			ans = ans * ((long) n - (long) i + 1L) / (long) i;
		}
		return ans;
	}

	public static ArrayList<Integer> arr[];
	public static boolean vis[];
	public static Stack<Integer> S;

	public static void bfs(int node) {
		for (int i = 0; i < arr[node].size(); i++) {
			int k = arr[node].get(i);
			if (vis[k] == false) {
				vis[k] = true;
				S.push(k);
				bfs(k);
			}
		}
		S.push(node);
	}

	public static void dfs(int node) {
		System.out.print(node + " ");
		for (int i = 0; i < arr[node].size(); i++) {
			int k = arr[node].get(i);
			if (vis[k] == false) {
				vis[k] = true;
				dfs(k);
			}
		}
	}

	public static int get(int a) {
		while (a % 2 == 0)
			a /= 2;
		while (a % 3 == 0)
			a /= 3;

		return a;
	}

	public static double ch(double x, int p, int q, int r, int s, int t, int u) {
		double w = (double) p * Math.pow(Math.E, -x) + (double) q * Math.sin(x)
				+ (double) r * Math.cos(x) + (double) s * Math.tan(x)
				+ (double) t * x * x + (double) u;
		return w;
	}

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader in = new BufferedReader(new FileReader("cubes.in"));

		StringBuilder qq = new StringBuilder();
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		// PrintWriter out = new PrintWriter(new FileWriter("out.txt"));
		int n = Integer.parseInt(in.readLine());

		String y[] = in.readLine().split(" ");
		int a[] = new int[n + 2];
		a[0] = 0;
		a[n + 1] = 0;
		for (int i = 1; i <= n; i++)
			a[i] = Integer.parseInt(y[i - 1]);

		int l[] = new int[n + 1];
		int r[] = new int[n + 1];
		l[1] = 1;
		r[n] = 1;

		for (int i = 2; i <= n; i++)
			l[i] = Math.min(a[i] , l[i - 1] + 1);

		for (int i = n - 1; i >= 1; i--)
			r[i] = Math.min(a[i], r[i + 1] + 1);
		int ans = 0;
		for (int i = 1; i <=n; i++){
			//System.out.println(l[i]+" "+r[i]);
			ans = Math.max(ans, Math.min(l[i], r[i]));
		}

		System.out.println(ans);
		out.close();

	}
}