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
//package math_codet;

import java.io.*;
import java.util.*;
 
public class lets_do {
    FastReader in;
    PrintWriter out;
    Helper_class h;
    final long mod = 1000000007;
    final int MAXN = 300005;
    final int lgN = 20;
    final long INF = (long)1e8;
    public static void main(String[] args) throws java.lang.Exception{
        new lets_do().run();
    }
    void run() throws Exception{
        in=new FastReader(System.in);
        out = new PrintWriter(System.out);
        h = new Helper_class();
        int t = 1;
        while(t-->0)
            solve();
        out.flush();
        out.close();
    }
    long[] arr;
    long[][] dp;
    int n, k;
    long go(int ind, int cnt){
    	if(cnt > k)
    		return -INF;
        if(ind == n)
            return 0;
        if(dp[ind][cnt] != -1)
            return dp[ind][cnt];
        long ways = 0;
        int i;
        for(i = ind + 1; i < n && arr[i] - arr[ind] <= 5; i++);
        //h.pn(i - ind +" "+i +" "+ind);
        ways = Math.max(go(ind + 1, cnt), go(i, cnt + 1) + (i - ind));
        dp[ind][cnt] = ways;
        return ways;
    }
    void solve(){
        n = h.ni();
        k = h.ni();
        arr = new long[n];
        int i = 0;
        for(i = 0; i < n; i++)
            arr[i] = h.nl();
        Arrays.sort(arr);
        dp = new long[n][k + 1];
        for(i = 0; i < n; i++)
            Arrays.fill(dp[i], -1);
        h.pn(go(0, 0));
    }
    static final Comparator<Pair> com = new Comparator<Pair>(){
        public int compare(Pair a, Pair b){
            if(Integer.compare(a.y, b.y) != 0)
                return Integer.compare(a.y, b.y);
            else
                return Integer.compare(a.x, b.x);
        }
    };
    
    class Pair{
        int x;
        int y;
        Pair(int p, int q){
            y = p;
            x = q;
        }
    }
    class Edge{
        int u , v, wt;
        Edge(int a, int b, int w){
            u = a;
            v = b;
            wt = w;
        }
        int other(int x) {
            return u ^ v ^ x;
        }
    }
    class Helper_class{
        long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
        int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
        int bitcount(long n){return (n==0)?0:(1+bitcount(n&(n-1)));}
        void p(Object o){out.print(o);}
        void pn(Object o){out.println(o);}
        void pni(Object o){out.println(o);out.flush();}
        String n(){return in.next();}
        String nln(){return in.nextLine();}
        int ni(){return Integer.parseInt(in.next());}
        long nl(){return Long.parseLong(in.next());}
        double nd(){return Double.parseDouble(in.next());}
 
        long mul(long a,long b){
            if(a>=mod)a%=mod;
            if(b>=mod)b%=mod;
            a*=b;
            if(a>=mod)a%=mod;
            return a;
        }
        long modPow(long a, long p){
            long o = 1;
            while(p>0){
                if((p&1)==1)o = mul(o,a);
                a = mul(a,a);
                p>>=1;
            }
            return o;
        }
        long add(long a, long b){
            if(a>=mod)a%=mod;
            if(b>=mod)b%=mod;
            if(b<0)b+=mod;
            a+=b;
            if(a>=mod)a-=mod;
            return a;
        }
    }
 
    class FastReader{
        private InputStream stream; 
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
 
        public FastReader(InputStream stream) {
            this.stream = stream;
        }
 
        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }
 
        public void skip(int x) {
            while (x-- > 0)
                read();
        }
 
        public int nextInt() {
            return Integer.parseInt(next());
        }
 
        public long nextLong() {
            return Long.parseLong(next());
        }
 
        public String nextString() {
            return next();
        }
 
        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
 
            return res.toString();
        }
 
        public String nextLine() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }
 
        public double nextDouble() {
            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, nextInt());
                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, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
 
        public boolean hasNext() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value != -1;
        }
 
        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    }
} 