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.math.*;
import java.util.*;
 
public class Main {
	//static final long MOD = 998244353;
	static final long MOD = 1000000007;
	static final int INF = 1000000007;
	
	static ArrayList<Integer> nums;
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int N = sc.ni();
		int K = sc.ni();
		nums = new ArrayList<Integer>(N+1);
		for (int i = 0; i < N; i++)
			nums.add(sc.ni());
		nums.add(Integer.MAX_VALUE);
		Collections.sort(nums);
		int[] curTeam = new int[N];
		for (int i = 0; i < N; i++)
			curTeam[i] = (i+1)-firstIndex(nums.get(i)-5);
		
		int[][] dp = new int[N+1][K+1];
		for (int j = 1; j <= K; j++) {
			for (int i = 1; i <= N; i++) {
				dp[i][j] = Math.max(dp[i-1][j],curTeam[i-1] + dp[i-curTeam[i-1]][j-1]);
				//Math.max(don't include on team, include on team)
			}
		}
		//System.out.println(Arrays.deepToString(dp));
		System.out.println(dp[N][K]);
	}
	
	public static int firstIndex(int val) {
		int L = 0;
		int R = nums.size();
		while (L<R) {
			int mid = (L+R)/2;
			if (nums.get(mid) >= val) {
				R = mid;
			} else {
				L = mid+1;
			}
		}
		return L;
	}
	
	static class DisjointSetUnion {
		  public int[] parent;
		  public int[] weight;
		  public int count;

		  public DisjointSetUnion(int nodes) {
		    count = nodes;
		    parent = new int[nodes];
		    weight = new int[nodes];
		    for (int i = 0; i < nodes; i++) {
		      parent[i] = i;
		      weight[i] = 1;
		    }
		  }
		  //"find"
		  public int root(int p) {
		    while (p != parent[p]) {
		      p = parent[p];
		    }
		    return p;
		  }

		  //"union"
		  public void connect(int p, int q) {
		    int rootP = root(p);
		    int rootQ = root(q);
		    if (rootP == rootQ) return;
		    if (weight[rootP] < weight[rootQ]) {
		      parent[rootP] = rootQ;
		      weight[rootQ] += weight[rootP];
		    } else {
		      parent[rootQ] = rootP;
		      weight[rootP] += weight[rootQ];
		    }
		    count--;
		  }

		  public boolean connected(int p, int q) {
		    return root(p) == root(q);
		  }
	}
    
    public static long power(long x, long y, long p) { 
        // Initialize result
        long res = 1;
         
        // Update x if it is more   
        // than or equal to p 
        x = x % p;  
      
        while (y > 0) 
        { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
      
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } 
        return res; 
    }
    
    public static long dist(int[] point, int[] point2) {
    	return (long)(Math.pow((point2[1]-point[1]),2)+Math.pow((point2[0]-point[0]),2));
    }
    
    public static long gcd(long a, long b) {
    	if (b == 0)
    		return a;
    	else
    		return gcd(b,a%b);
    }
    
    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  return arr2[1]-arr1[1];
	          }
		});
		return array;
	}
    
    static class FastScanner { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastScanner() { 
            br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
  
        String next() { 
            while (st == null || !st.hasMoreElements()) { 
                try { 
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int ni() { 
            return Integer.parseInt(next()); 
        } 
  
        long nl() { 
            return Long.parseLong(next()); 
        } 
  
        double nd() { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() { 
            String str = ""; 
            try { 
                str = br.readLine(); 
            } catch (IOException e) {
                e.printStackTrace(); 
            } 
            return str; 
        }
    }
}