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.util.*;
import java.io.*;
public class Main{
	public static Scanner sc=new Scanner(System.in);
	public static long gcd(long a,long b) {
		long c;
	    while ( a != 0 ) {
	        c = a; a = b%a;  b = c;
	    }
	    return b;
	}
	public static void main(String[] args) throws FileNotFoundException{
			InputStream inputStream = System.in;
			InputReader in = new InputReader(inputStream);
			int n=in.nextInt();
			int a[]=new int[n];
			for(int i=0;i<n;i++)
				a[i]=in.nextInt();
			int left[]=new int [n],right[]=new int [n];
			left[0]=1;
			for(int i=1;i<n;i++) {
				left[i]=Math.min(left[i-1]+1,a[i]);
			}
			right[n-1]=1;
			int ans=1;
			for(int i=n-2;i>=0;i--) {
				right[i]=Math.min(right[i+1]+1,left[i]);
				ans=Math.max(ans,right[i]);
			}
			System.out.println(ans);
			/*
			InputStream inputStream = System.in;
	        InputReader in = new InputReader(inputStream);
	        int n=in.nextInt(),m=in.nextInt(),ans=0;
	        int a[][]=new int [n][m];
	        for(int i=0;i<n;i++)
	        	for(int j=0;j<m;j++)
	        		a[i][j]=in.snext();
	        int last=0;
	        ArrayList<BIT> tree=new ArrayList<BIT>();
	        for(int i=0;i<=m;i++) 
	        	tree.add(i,new BIT());
	        for(int i=0;i<n;i++) {
	        	for(int j=0;j<m;j++) {
	        		if(a[i][j]==0)
	        			last=i+1;
	        		else tree.get(j).update(last);
	        	}
	        }
	        for(int i=0;i<m;i++) {
	        	for(int j=0;j<=i;j++) {
	        		ans=Math.max(ans,tree.get(j).read(i+1)-tree.get(j).read(i));
	        	}
	        }
	        System.out.println(ans);
	        /*int n=in.nextInt(),m=in.nextInt();
	        int v[]=new int[n],c[]=new int[n];
	        for(int i=0;i<n;i++)
	        	v[i]=in.nextInt();
	        for(int i=0;i<n;i++) {
	        	c[i]=in.nextInt();
	        }
	        
	        for(int j=0;j<m;j++) {
	        	int a=in.nextInt(),b=in.nextInt();
		        int hash[]=new int [n+1],dp[]=new int[n],included[]=new int[n];
		        for(int i=0;i<=n;i++)
		        	hash[i]=-1;
		        if(b*v[0]>=0) {
			        dp[0]=b*v[0];
			        hash[c[0]]=0;
		        }else dp[0]=0;
	        	//System.out.println(dp[0]);
		    
	        	for(int i=1;i<n;i++) {
	        		dp[i]=dp[i-1];
	        		if(hash[c[i]]!=-1) {
	        			if(a*v[i]+dp[hash[c[i]]]>=dp[i-1]) {
	        				hash[c[i]]=i;
	        				dp[i]=a*v[i]+dp[hash[c[i]]];
	        			}
	        		}
	        		if(b*v[i]>=0) {
	        			hash[c[i]]=i;
	        			dp[i]=Math.max(dp[i],b*v[i]+dp[i-1]);
	        		}
		        	//System.out.println(dp[i]);
	        	}
	        	System.out.println(dp[n-1]);
	        }*/
	}
	
	static class InputReader {
		 
		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar;
		private int snumChars;
		private SpaceCharFilter filter;
 
		public InputReader(InputStream stream) {
			this.stream = stream;
		}
 
		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
 
			int res = 0;
 
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
 
			return res * sgn;
		}
		
		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}
class BIT{
	int MaxVal=5500;
	int tree[]=new int[MaxVal];
	public int read(int idx){
	    int sum = 0;
	    while (idx > 0){
	        sum += tree[idx];
	        idx -= (idx & -idx);
	    }
	    return sum;
	}
	public void update(int idx){
	    while (idx < MaxVal){
	        tree[idx] ++;
	        idx += (idx & -idx);
	    }
	}
}