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 form k teams for yet another new programming competition. As you know, the more students are involved in competition the more probable the victory of your university is! So you have to form no more than k (and at least one) non-empty teams so that the total number of students in them is maximized. But you also know that each team should be balanced. It means that the programming skill of each pair of students in each team should differ by no more than 5. Teams are independent from one another (it means that the difference between programming skills of two students from two different teams does not matter).

It is possible that some students not be included in any team at all.

Your task is to report the maximum possible total number of students in no more than k (and at least one) non-empty balanced teams.

If you are Python programmer, consider using PyPy instead of Python when you submit your code.

Input

The first line of the input contains two integers n and k (1 ≤ k ≤ n ≤ 5000) — the number of students and the maximum number of teams, correspondingly.

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 total number of students in no more than k (and at least one) non-empty balanced teams.

Examples

Input


5 2
1 2 15 15 15


Output


5


Input


6 1
36 4 1 25 9 16


Output


2


Input


4 4
1 10 100 1000


Output


4
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class d extends PrintWriter{
    static BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
    // static Scanner s=new Scanner(System.in);
    d() { super(System.out); }
    public static void main(String[] args) throws IOException{
        d d1=new d();d1.main();d1.flush();
    }void main() throws IOException {
        StringBuilder sb = new StringBuilder();
        PrintWriter out = new PrintWriter(System.out);
         String[] s1=s();
         int n=i(s1[0]);int k=i(s1[1]);
         String[]s2=s();
         int[] a=new int[n];for(int i=0;i<n;i++) {a[i]=i(s2[i]);}
         Arrays.sort(a);
         int[][] dp=new int[n][k];
         int l=0;
         int ans=0;

         for(int i=0;i<n;i++){
//             System.out.print(a[i]+" ");
             while(a[i]-a[l]>5) l++;
             dp[i][0]=i-l+1;
             ans=Math.max(ans,dp[i][0]);
             for(int j=1;j<k;j++){
                 if(l-1>=0&&dp[l-1][j-1]!=0)
                  dp[i][j]=dp[l-1][j-1]+i-l+1;
                // System.out.println(i+" "+j+" "+dp[i][j]);
                 ans=Math.max(ans,dp[i][j]);
               if(i>0) dp[i][j]=Math.max(dp[i][j],dp[i-1][j]);
             }
             if(i>0)
             dp[i][0]=Math.max(dp[i][0],dp[i-1][0]);
         }
        System.out.println(ans);


    }static StringBuilder sb1;
    static void dfs(ArrayList<Integer> [] adj,int [] vis,int i){
        vis[i]=1; if(adj[i]==null) return;
        for(Integer j:adj[i]){
            if(vis[j]==0){
                sb1.append(i+" "+j);
                dfs(adj,vis,j);
            }
        }
    }
      static int ft;static int ans;


    static String[] s() throws IOException {

        return s.readLine().trim().split("\\s+");
    }

    static int i(String ss) {
        return Integer.parseInt(ss);
    }
    static long l(String ss) {
        return Long.parseLong(ss);
    }
}
class node implements Comparator<node>{
    int ver,val;
    public node(){}
    public node(int ver,int val) {
        this.ver=ver;this.val=val;
    }public int compare(node n1,node n2){
       return n1.val-n2.val;
    }
}

class Student12 {
    int  l;int r;
    public Student12(int l, int r) {
        this.l = l;
        this.r = r;
    }

    public String toString()
    {
        return this.l+" ";
    }
}
class Sortbyroll12 implements Comparator<Student12> {

    public int compare(Student12 a, Student12 b){
        return a.l-b.l;
//        if(a.r<b.r) return 1;else if(a.r==b.r) return 0;else return -1;// a.r-b.r;
      /*  if(b.r<a.r) return -1;
        else if(b.r==a.r) return 0;
        return 1;*/

        //   return b.r-a.r;
       /*
       if(b.l<a.l) return -1;
       else if(b.l==a.l) {
           return b.r-a.r;
       }
       return 1;*/
        //        return b.r- a.r;
        //        return (int) a.l-(int) b.l;
         /*   if(a.r<b.r) return -1;
            else if(a.r==b.r){
                if(a.r==b.r){
                    return 0;
                }
                if(a.r<b.r) return -1;
                return 1;}
            return 1;  */}
}
class Node1 implements Comparator<Node1>{
    int node;long val;
    public  Node1(){}
    public  Node1(int node,long val){
        this.node=node;this.val=val;
    }
    @Override
    public int compare(Node1 a,Node1 b){
        if(a.val<b.val) return -1;
        if(a.val==b.val) return 0;
        {
            return 1;
        }
    }
}
