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: y_1, y_2, ..., y_{n} (0 ≤ y_{i} ≤ 5), where y_{i} 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.

Difficulty: interview

Starter code:

Solutions:
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in a:
    if 5 - i >= k:
        ans += 1
print(ans // 3)

n, k = map(int, input().split())
a = list(map(int, input().split()))
sum = 0
for i in range(len(a)):
    if a[i] + k <= 5:
        sum += 1
print(sum//3)

n, k = map(int, input().split())
y = list(map(int, input().split()))
ans = 0
for a in y:
    if a <= 5 - k:
        ans += 1
print(ans // 3)

n, k = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for i in a:
    if 5 - i >= k:
        cnt += 1
print(cnt // 3)

n, k = list(map(int, input().split()))
g = list(map(int, input().split()))
r = 0
for i in g:
    if i <= 5-k:
        r+=1

print(r//3)


n, k = list(map(int, input().split()))
a = list(map(int, input().split()))

ans = 0
for i in a:
    if (5 - i >= k):
        ans += 1

print(ans // 3)


n, k = map(int, input().split())
s = list(map(int, input().split()))
print(sum(1 for i in s if 5 - i >= k) // 3)

n, k = list(map(int, input().split()))
yi = list(map(int, input().split()))
num_peo = 0
for peo in yi:
    if peo <= 5 - k:
        num_peo += 1
print(num_peo // 3)


n, k = map(int, input().split())
print(len([a for a in sorted(map(int, input().split())) if a <= 5 - k]) // 3)

__copyright__ = ''
__author__ = 'Son-Huy TRAN'
__email__ = "sonhuytran@gmail.com"
__doc__ = ''
__version__ = '1.0'


def main() -> int:
    (n, k) = map(int, input().split())
    times = [int(word) for word in input().split()]
    max = 5 - k

    result = sum(1 for time in times if time <= max)
    print(result // 3)

    return 0


def __starting_point():
    exit(main())
__starting_point()

__author__ = 'Lipen'

def main():
	n, k = map(int, input().split())
	ydata = sorted(list(map(int, input().split())))
	ans = 0

	for i in range(n//3):
		d = ydata[i*3:(i+1)*3]
		if d[0]<=5-k and d[1]<=5-k and d[2]<=5-k:
			ans+=1
		else:
			break

	print(ans)

main()

(n,k)=list(map(int, input().split()))
a=list(map(int, input().split()))
ans=0
for i in range(n):
    if 5-a[i]>=k:
        ans+=1   
print(ans//3)


def read():
    return map(int, input().split())

n, k = read()
a = list(read())
a.sort()
i = 0
ans = 0
while i + 2 < len(a):
    if a[i]+k<=5 and a[i+1]+k<=5 and a[i+2]+k<=5:
        ans += 1
        i+=3
    else:
        i+=1
print(ans)

from sys import stdin as cin
from math import factorial as f
n,k= map(int,(cin.readline().split()))
a = list(map(int,(cin.readline().split())))
a.sort()
#print(a)
count = 0
tmp = 0
for x in a:

	if 5-x-k>=0:
		tmp+=1
		flag = 1
	else:
		flag = 0

	if tmp%3 == 0 and flag==1:
		tmp = 0
		count+=1
	#print(tmp,5-x-k,count)
print(count)

import sys

f = sys.stdin
n, k, = list(map(int, f.readline().strip().split()))

A = [int(u) for u in f.readline().strip().split()]


m = 0
for u in A:
    if u+k<=5:
       m += 1

print(m//3)


n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
a.sort()
l,r=0,n
while r-l>1:
    m=(r+l)//2
    if a[m]>5-k:
        r=m
    else:
        l=m
print((l+1)//3)


a = [int(x) for x in input().split()]
n, k = a[0], a[1]
a = [int(x) for x in input().split()]
n = 5 - k
ch = 0
for i in a:
    if i <= n:
        ch += 1
print((ch-ch%3)//3)

import sys
import math
from random import randint
n, k = map(int, input().split())
y = list(map(int, input().split()))
ans = 0
for i in range(n):
    if k + y[i] <= 5:
        ans+=1
print(ans // 3)

n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
i=2
ans=0
while i<n:
    if a[i]+k<=5:
        ans+=1
    i+=3
print(ans)

n,k = input().split(' ')
n = int(n); k = int(k)
y = [int(x) for x in input().split(' ')]
teams = 0
st = []
for x in y:
    if 5-x >= k:
        st.append(x)
teams = len(st)//3
print(teams)


n, k = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
    if a[i] + k <= 5:
        cnt += 1
print(cnt // 3)

n, k = list(map(int, input().split()))
k = 6 - k
l = list(map(int, input().split()))
c = 0
for i in l:
    if i < k:
        c += 1
print(c//3)


n, k = map(int, input().split())
a = list(map(int, input().split()))
k = 5 - k
cnt = 0
for i in range(n):
    if a[i] <= k:
        cnt += 1
print(cnt // 3)

#!/usr/bin/env python3.3
# coding=utf-8

def main():
    try:
        t = input()
        s = t.split(' ')
        n = int(s[0])
        k = int(s[1])

        t = input()
        s = t.split(' ')
        ans = 0
        for i in range(n):
            if int(s[i])+k<=5:
                ans =ans+1
        print(int(ans/3))
    except EOFError:
        return
def __starting_point():
    main()

__starting_point()

a = [int(x) for x in input().split()]
n, k = a[0], a[1]
a = [int(x) for x in input().split()]
n = 5 - k
ch = 0
for i in a:
    if i <= n:
        ch += 1
print((ch-ch%3)//3)