The Saratov State University Olympiad Programmers Training Center (SSU OPTC) has n students. For each student you know the number of times he/she has participated in the ACM ICPC world programming championship. According to the ACM ICPC rules, each person can participate in the world championship at most 5 times.

The head of the SSU OPTC is recently gathering teams to participate in the world championship. Each team must consist of exactly three people, at that, any person cannot be a member of two or more teams. What maximum number of teams can the head make if he wants each team to participate in the world championship with the same members at least k times?

Input

The first line contains two integers, n and k (1 ≤ n ≤ 2000; 1 ≤ k ≤ 5). The next line contains n integers: y1, y2, ..., yn (0 ≤ yi ≤ 5), where yi shows the number of times the i-th person participated in the ACM ICPC world championship.

Output

Print a single number — the answer to the problem.

Examples

Input

5 2
0 4 5 1 0


Output

1


Input

6 4
0 1 2 3 4 5


Output

0


Input

6 5
0 0 0 0 0 0


Output

2

Note

In the first sample only one team could be made: the first, the fourth and the fifth participants.

In the second sample no teams could be created.

In the third sample two teams could be created. Any partition into two teams fits.
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    
    private static final class FastScanner {
        private final InputStream is = System.in;
        private final byte[] buf = new byte[8192];
        private int curChar;
        private int numChars;
 
        public FastScanner() {
        }
 
        public int read() {
                if (this.numChars == -1) {
                        throw new InputMismatchException();
                }
                if (this.curChar >= this.numChars) {
                        this.curChar = 0;
                        try {
                                this.numChars = this.is.read(this.buf);
                        } catch (final IOException e) {
                                throw new InputMismatchException();
                        }
                        if (this.numChars <= 0) {
                                return -1;
                        }
                }
                return this.buf[this.curChar++];
        }
 
        public String nextLine() {
                int c;
                while (isSpaceChar(c = read())) {
                }
                final StringBuilder res = new StringBuilder();
                do {
                        res.appendCodePoint(c);
                } while (!isEndOfLine(c = read()));
                return res.toString();
        }
 
        public String nextString() {
                int c;
                while (isSpaceChar(c = read())) {
                }
                final StringBuilder res = new StringBuilder();
                do {
                        res.appendCodePoint(c);
                } while (!isSpaceChar(c = read()));
                return res.toString();
        }
 
        public long nextLong() {
                int c;
                while (isSpaceChar(c = read())) {
                }
                boolean f = true;
                if (c == '-') {
                        f = false;
                        c = read();
                }
                long res = 0;
                do {
                        /*if (c < '0' || c > '9') {
                                throw new InputMismatchException();
                        }*/
                        res = res * 10 + c - '0';
                } while ((c = read()) >= '0' && c <= '9');
                return f ? res : -res;
        }
 
        public int nextInt() {
                int c;
                while (isSpaceChar(c = read())) {
                }
                boolean f = true;
                if (c == '-') {
                        f = false;
                        c = read();
                }
                int res = 0;
                do {
                        /*if (c < '0' || c > '9') {
                                throw new InputMismatchException();
                        }*/
                        res = res * 10 + c - '0';
                } while ((c = read()) >= '0' && c <= '9');
                return f ? res : -res;
        }
 
        public double nextDouble() {
                return Double.parseDouble(nextString());
                // return FloatingDecimal.parseDouble(nextString());
        }
 
        public BigInteger nextBigInteger() {
                return new BigInteger(nextString(), 10);
        }
 
        public BigDecimal nextBigDecimal() {
                return new BigDecimal(nextString());
        }
 
        public int[] nextArray(final int n) {
                final int[] a = new int[n];
                for (int i = 0; i < n; i++) {
                        a[i] = nextInt();
                }
                return a;
        }
 
        public long[] nextLongArray(final int n) {
                final long[] a = new long[n];
                for (int i = 0; i < n; i++) {
                        a[i] = nextLong();
                }
                return a;
        }
 
        public char[] nextCharArray(final int n) {
                final char[] bf = new char[n];
                int b, p = 0;
                while (isSpaceChar(b = read())) {
                }
                while (p < n && !isSpaceChar(b)) {
                        bf[p++] = (char) b;
                        b = read();
                }
                return n == p ? bf : Arrays.copyOf(bf, p);
        }
 
        public char[][] nextMatrix(final int n, final int m) {
                final char[][] map = new char[n][];
                for (int i = 0; i < n; i++) {
                        map[i] = nextCharArray(m);
                }
                return map;
        }
 
        public int[][] nextIntMatrix(final int n, final int m) {
                final int[][] map = new int[n][];
                for (int i = 0; i < n; i++) {
                        map[i] = nextArray(m);
                }
                return map;
        }
 
        public long[][] nextLongMatrix(final int n, final int m) {
                final long[][] map = new long[n][];
                for (int i = 0; i < n; i++) {
                        map[i] = nextLongArray(m);
                }
                return map;
        }
 
        public boolean isSpaceChar(final int c) {
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        public boolean isEndOfLine(final int c) {
                return c == '\n' || c == '\r' || c == -1;
        }
    }
            
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner();
        // BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        // StringTokenizer v;
        PrintWriter out = new PrintWriter(System.out);
        StringBuilder r = new StringBuilder();
        
        int n = in.nextInt();
        int k = in.nextInt();
        
        int x = n % 3;
        int[] arr = new int[n + (x == 0 ? 0 : (3-x))];
        
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        
        for (int i = n; i < arr.length; i++) {
            arr[i] = 5;
        }
        
        // System.out.println(Arrays.toString(arr));
        
        Arrays.sort(arr);
        
        int count = 0;
        for (int i = 0; i < arr.length; i += 3) {
            int max = Math.max(arr[i], Math.max(arr[i+1], arr[i+2]));
            if(5 - max >= k) {
                count++;
            } else {
                break;
            }
        }
        // System.out.println(arr.length);
        r.append(count + "\n");
        
        out.print(r);
        out.flush();
        out.close();
    }
  
}