Problem: You are a coach at your local university. There are n students under your supervision, the programming skill of the i-th student is a_i.

You have to create a team for a new programming competition. As you know, the more students some team has the more probable its victory is! So you have to create a team with the maximum number of students. But you also know that a team should be balanced. It means that the programming skill of each pair of students in a created team should differ by no more than 5.

Your task is to report the maximum possible number of students in a balanced team.

Input

The first line of the input contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of students.

The second line of the input contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9), where a_i is a programming skill of the i-th student.

Output

Print one integer — the maximum possible number of students in a balanced team.

Examples

Input


6
1 10 17 12 15 2


Output


3


Input


10
1337 1337 1337 1337 1337 1337 1337 1337 1337 1337


Output


10


Input


6
1 1000 10000 10 100 1000000000


Output


1

Note

In the first example you can create a team with skills [12, 17, 15].

In the second example you can take all students in a team because their programming skills are equal.

In the third example you can create a team consisting of a single student (and you cannot create a team consisting of at least two students).

Solution (in JAVA):

Solution:


import java.io.*;
import java.util.*;
public class c1{
	
	

		
		public static void main(String[] args) throws IOException 
		{// In the name of God

int n=i(),k=i();
int dp[][]=new int[n+1][k+1];
int a[]=new int[n];
int b[]=new int[n];
		for(int r=0;r<n;r++)
{
			b[r]=n;		
	a[r]=i();
}
		Arrays.sort(a);
		
		int p=0,q=0;
		for(int r=0;p<n && q<n;r++)
		{
			
			if(a[q]-a[p]>5)
			{
				b[p]=q;
			//	out.print(b[p]+" ");
				p++;
			}
			else
			{
				q++;
			}
		}
	//	out.println();
		for(int u=n-1;u>=0;u--)
		{
			for(int w=1;w<=k;w++)
			{
		
					dp[u][w]=Math.max(dp[u+1][w],b[u]-u+dp[b[u]][w-1]);
				//	out.print(dp[u][w]+" ");
			}
		//	out.println();
		}
int ma=Integer.MIN_VALUE;
for(int y=0;y<=k;y++)
{
	ma=Math.max(ma, dp[0][y]);
//	out.println(dp[0][y]);
}
out.println(ma);
		out.close();
		    }
		
		
		
		static InputReader in = new InputReader(System.in);
		    static OutputWriter out = new OutputWriter(System.out);
		    
		    static int i()
		    {
		    	return in.readInt();
		    }
		    
		    static long l()
		    {
		    	return in.readLong();
		    }
		    
		    static double d()
		    {
		    	return in.readDouble();
		    }
		    
		    static String s()
		    {
		    	return in.readString();
		    }
		    
		    static void Iarr( int[] array, int no )
		    {
		    	for( int i=0 ; i<no ; i++ )
		    	{
		    		array[i] = i(); 
		    	}
		    }
		    
		    static void Larr( long[] array, int no )
		    {
		    	for( int i=0 ; i<no ; i++ )
		    	{
		    		array[i] = l(); 
		    	}
		    }
		    
		    static void Darr( double[] array, int no )
		    {
		    	for( int i=0 ; i<no ; i++ )
		    	{
		    		array[i] = d(); 
		    	}
		    }
		    
		    static void Sarr( String[] array, int no )
		    {
		    	for( int i=0 ; i<no ; i++ )
		    	{
		    		array[i] = s(); 
		    	}
		    }
		    
		    private static class InputReader
		    {
		        private InputStream stream;
		        private byte[] buf = new byte[1024];
		        private int curChar;
		        private int numChars;
		        private SpaceCharFilter filter;
		 
		        public InputReader(InputStream stream)
		        {
		            this.stream = stream;
		        }
		 
		        
		        
		        
		        
		        
		        
		        public int read()
		        {
		            if (numChars == -1)
		                throw new InputMismatchException();
		            if (curChar >= numChars)
		            {
		                curChar = 0;
		                try
		                {
		                    numChars = stream.read(buf);
		                } catch (IOException e)
		                {
		                    throw new InputMismatchException();
		                }
		                if (numChars <= 0)
		                    return -1;
		            }
		            return buf[curChar++];
		        }
		 
		        public int readInt()
		        {
		            int c = read();
		            while (isSpaceChar(c))
		                c = read();
		            int sgn = 1;
		            if (c == '-')
		            {
		                sgn = -1;
		                c = read();
		            }
		            int res = 0;
		            do
		            {
		                if (c < '0' || c > '9')
		                    throw new InputMismatchException();
		                res *= 10;
		                res += c - '0';
		                c = read();
		            } while (!isSpaceChar(c));
		            return res * sgn;
		        }
		 
		        public String readString()
		        {
		            int c = read();
		            while (isSpaceChar(c))
		                c = read();
		            StringBuilder res = new StringBuilder();
		            do
		            {
		                res.appendCodePoint(c);
		                c = read();
		            } while (!isSpaceChar(c));
		            return res.toString();
		        }
		        public double readDouble() {
		            int c = read();
		            while (isSpaceChar(c))
		                c = read();
		            int sgn = 1;
		            if (c == '-') {
		                sgn = -1;
		                c = read();
		            }
		            double res = 0;
		            while (!isSpaceChar(c) && c != '.') {
		                if (c == 'e' || c == 'E')
		                    return res * Math.pow(10, readInt());
		                if (c < '0' || c > '9')
		                    throw new InputMismatchException();
		                res *= 10;
		                res += c - '0';
		                c = read();
		            }
		            if (c == '.') {
		                c = read();
		                double m = 1;
		                while (!isSpaceChar(c)) {
		                    if (c == 'e' || c == 'E')
		                        return res * Math.pow(10, readInt());
		                    if (c < '0' || c > '9')
		                        throw new InputMismatchException();
		                    m /= 10;
		                    res += (c - '0') * m;
		                    c = read();
		                }
		            }
		            return res * sgn;
		        }
		        public long readLong() {
		            int c = read();
		            while (isSpaceChar(c))
		                c = read();
		            int sgn = 1;
		            if (c == '-') {
		                sgn = -1;
		                c = read();
		            }
		            long res = 0;
		            do {
		                if (c < '0' || c > '9')
		                    throw new InputMismatchException();
		                res *= 10;
		                res += c - '0';
		                c = read();
		            } 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 String next()
		        {
		            return readString();
		        }
		 
		        public interface SpaceCharFilter
		        {
		            public boolean isSpaceChar(int ch);
		        }
		    }
		 
		    private static class OutputWriter
		    {
		        private final PrintWriter writer;
		 
		        public OutputWriter(OutputStream outputStream)
		        {
		            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		        }
		 
		        public OutputWriter(Writer writer)
		        {
		            this.writer = new PrintWriter(writer);
		        }
		 
		        public void print(Object... objects)
		        {
		            for (int i = 0; i < objects.length; i++)
		            {
		                if (i != 0)
		                    writer.print(' ');
		                writer.print(objects[i]);
		            }
		        }
		 
		        public void println(Object... objects)
		        {
		            print(objects);
		            writer.println();
		        }
		 
		        public void close()
		        {
		            writer.close();
		        }
		 
		        public void flush()
		        {
		            writer.flush();
		        }
		     }
		}