International Women's Day is coming soon! Polycarp is preparing for the holiday.

There are $n$ candy boxes in the shop for sale. The $i$-th box contains $d_i$ candies.

Polycarp wants to prepare the maximum number of gifts for $k$ girls. Each gift will consist of exactly two boxes. The girls should be able to share each gift equally, so the total amount of candies in a gift (in a pair of boxes) should be divisible by $k$. In other words, two boxes $i$ and $j$ ($i \ne j$) can be combined as a gift if $d_i + d_j$ is divisible by $k$.

How many boxes will Polycarp be able to give? Of course, each box can be a part of no more than one gift. Polycarp cannot use boxes "partially" or redistribute candies between them. 


-----Input-----

The first line of the input contains two integers $n$ and $k$ ($1 \le n \le 2 \cdot 10^5, 1 \le k \le 100$) — the number the boxes and the number the girls.

The second line of the input contains $n$ integers $d_1, d_2, \dots, d_n$ ($1 \le d_i \le 10^9$), where $d_i$ is the number of candies in the $i$-th box.


-----Output-----

Print one integer — the maximum number of the boxes Polycarp can give as gifts.


-----Examples-----
Input
7 2
1 2 2 3 2 4 10

Output
6

Input
8 2
1 2 2 3 2 4 6 10

Output
8

Input
7 3
1 2 2 3 2 4 5

Output
4



-----Note-----

In the first example Polycarp can give the following pairs of boxes (pairs are presented by indices of corresponding boxes):   $(2, 3)$;  $(5, 6)$;  $(1, 4)$. 

So the answer is $6$.

In the second example Polycarp can give the following pairs of boxes (pairs are presented by indices of corresponding boxes):   $(6, 8)$;  $(2, 3)$;  $(1, 4)$;  $(5, 7)$. 

So the answer is $8$.

In the third example Polycarp can give the following pairs of boxes (pairs are presented by indices of corresponding boxes):   $(1, 2)$;  $(6, 7)$. 

So the answer is $4$.

Difficulty: introductory

Starter code:

Solutions:
n, k = map(int, input().split())
D = list(map(int, input().split()))
z = {i: 0 for i in range(k)}
for i in range(n):
    z[D[i] % k] += 1
cnt = z[0] // 2
for q in range(1, k // 2 + k % 2):
    cnt += min(z[q], z[k - q])
if k % 2 == 0:
    cnt += z[k // 2] // 2
print(cnt * 2)

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

count = [0] * k
for x in d:
    count[x%k] += 1

result = count[0]//2
for i in range(1, k):
    if i*2 >= k:
        break
    result += min(count[i], count[k-i])

if k%2==0:
    result += count[k//2]//2
print(result*2)

n, k = list(map(int, input().split()))
counts = [0] * k
for i in map(int, input().split()):
    counts[i % k] += 1

c = counts[0] // 2
for i in range(1, k):
    if 2 * i >= k:
        break
    c += min(counts[i], counts[k - i])
if k % 2 == 0:
    c += counts[k // 2] // 2

print(2 * c)


def main():
    n, k = list(map(int, input().split()))
    cnt = [0] * k
    ans = 0
    arr = list(map(int, input().split()))
    for el in arr:
        t = el % k
        if (cnt[(k - t) % k] > 0):
            cnt[(k - t) % k] -= 1
            ans += 2
        else:
            cnt[t] += 1
    print(ans)
 
 
main()


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

ans = [0] * k

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

for c in a:
	ans[c % k] += 1
kol = ans[0] - ans[0] % 2
for i in range(1, int(k / 2 + 0.5)):
	kol += min(ans[i], ans[k - i]) * 2
	#print(ans[i], ans[k - i], i)

if k % 2 == 0:
	kol += ans[k // 2] - ans[k // 2] % 2
#print(ans)
print(kol)


n, k = list(map(int,input().split()))
di = list(map(int,input().split()))
ai  = [0] * k
for i in di:
    ai[i % k] += 1
ans = ai[0] // 2
ai[0] = 0
for i in range(1,k):
    num = i
    num2 = k - i
    if num != num2:
        ans += min(ai[num], ai[num2])
    else:
        ans += ai[num] // 2
    ai[num] = 0
    ai[num2] = 0
print(ans * 2)


n, k = list(map(int, input().split()))
d = list(map(int, input().split()))
di = dict()
for i in range(n):
    if d[i] % k in di:
        di[d[i] % k] += 1
    else:
        di[d[i] % k] = 1
ans = 0
if 0 in di:
    ans = di[0] // 2
for i in range(1, k // 2 + 1):
    if i in di and k - i in di:
        if i == k - i:
            ans += di[i] // 2
        else:
            ans += min(di[i], di[k - i])
print(ans * 2)


n,k = [int(x) for x in input().split()]

L = [int(x) for x in input().split()]

D = [0]*k

for i in L:
    D[i%k] += 1
    
s = 0    
for i in range((k+2)//2):
    if i == 0:
        s += 2*(D[0]//2)
    elif (k%2 == 0) and (i == k//2):
        s += 2*(D[i]//2)
    else:
        s += 2*min(D[i],D[k-i])
    
print(s)

n,k=map(int,input().split())
d=[*map(int,input().split())]
cnt=[0]*k
for i in d:
    cnt[i%k]+=1
ans=cnt[0]//2
for i in range(1,k):
    req=k-i
    if i<req:
        ans+=min(cnt[i],cnt[req])
    elif i==req:
        ans+=cnt[i]//2
print(ans*2)

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
d = [0] * k
for i in range(n):
    d[a[i] % k] += 1

num = 0
for i in range(k):
    if k - i < i:
        break
    if i == 0:
        num += d[i] // 2
    elif i == k - i:
        num += d[i] // 2
    else:
        num += min(d[i], d[k - i])

print(num * 2)


from collections import Counter as C
n, k = map(int, input().split())
l = [int(x) % k for x in input().split()]
c = C(l)
res = 0
for i in range(k):
    j = -i % k
    vi, vj = c.get(i, 0), c.get(j, 0)
    if i == j:
        res += vi // 2
    else:
        res += min(vi, vj)
    c[i] = 0
print(res * 2)

n, K = map(int, input().split())
arr = map(int, input().split())
freq = [0 for _ in range(K)]
for x in arr:
    freq[x%K] += 1
ans = 2*(freq[0]//2)
for i in range(1, K):
    if i < K-i:
        ans += 2*(min(freq[i], freq[K-i]))
    elif i == K-i:
        ans += 2*(freq[i]//2)
print(ans)

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

d = {}

for i in range(k):
    d[i] = 0

for i in range(len(l)):
    l[i] = l[i]%k
    d[l[i]] += 1 

s = 0

s += d[0]//2

for i in range(1,k//2):
    s += min(d[i],d[k-i])

if k % 2 == 0:
    s += d[k//2] // 2
else:
    if k != 1:
        s += min(d[k//2],d[k-k//2])
        
print(s*2)


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

D2=[d%k for d in D]

from collections import Counter
c=Counter(D2)

ANS=c[0]//2*2
if k%2==0:
    ANS+=c[k//2]//2*2
for i in range(1,-(-k//2)):
    ANS+=min(c[i],c[k-i])*2

print(ANS)
    


# -*- coding: utf-8 -*-
# @Time    : 2019/3/7 23:13
# @Author  : LunaFire
# @Email   : gilgemesh2012@gmail.com
# @File    : B. Preparation for International Women's Day.py

from collections import Counter


def main():
    n, k = map(int, input().split())
    d = list(map(int, input().split()))

    counter = Counter()
    for x in d:
        counter[x % k] += 1

    ret = counter[0] // 2 * 2
    for i in range(1, k):
        if i != k - i:
            ret += min(counter[i], counter[k - i])
        else:
            ret += counter[i] // 2 * 2
    print(ret)


def __starting_point():
    main()
__starting_point()

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

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

divs = {}
handled = [False, ] * k

for x in a:
    divs[x % k] = divs.get(x % k, 0) + 1

result = divs.get(0, 0) - divs.get(0, 0) % 2

for i in range(1, k):
    if not handled[i] and not handled[k - i]:
        if i != k - i:
            result += 2 * min(divs.get(i, 0), divs.get(k - i, 0))
        else:
            result += divs.get(i, 0) - divs.get(i, 0) % 2
        handled[i] = handled[k - i] = True

print(result)


#map(int,input().split())
#int(input())
n,k=map(int,input().split())
a=list(map(int,input().split()))
d = dict()
for i in range(n):
    m=a[i]%k
    if m not in d:
       d[m]=1
    else:
        d[m]+=1
ans=0
if 0 in d:
   ans = d[0]//2
h=k//2
if k%2==0 and h in d:
    ans  += d[h]//2
for i in range(1,(k+1)//2):
    if i in d and k-i in d:
       ans += min(d[i],d[k-i])
print(ans*2)

from math import floor
from collections import defaultdict

n, k = map(int, input().split())
a = defaultdict(int)
for i in input().split():
    i = int(i) % k
    a[i] += 1
r = 0
for i in range(floor(k / 2) + 1):
    if i == 0 or i == k - i:
        r += a[i] // 2
    else:
        r += min(a[i], a[k - i])
print(r * 2)

n,k=tuple(map(int,input().strip().split(" ")))
numbers=tuple(map(int,input().strip().split(" ")))
l=[]
for i in range(k):
    l.append(0)
for i in numbers:
    l[i%k]+=1
s=(l[0]//2)*2
import math
for g in range(1,math.ceil(k/2)):
    s=s+(min(l[g],l[k-g])*2)
if(k%2==0):
    s=s+((l[k//2]//2)*2)
print(s)

def main():
    n,k = list(map(int,input().split()))
    candy = list(map(int,input().split()))
    candies = []
    zeroes = 0
    for i in candy:
        mod = i%k
        if mod == 0:
            zeroes += 1
        else:
            candies.append(mod)

    candies.sort()

    boxes = zeroes//2

    candy_dict = {}

    for i in candies:
        if i not in list(candy_dict.keys()):
            candy_dict[i] = 1
        else:
            candy_dict[i] += 1

    #print (candy_dict)
    for i in candy_dict:
        if candy_dict[i] > 0:
            if (k-i) in list(candy_dict.keys()):
                if candy_dict[k-i] > 0:
                    if i == (k-i):
                        box = candy_dict[i]//2
                        candy_dict[i] = candy_dict[i]%2
                    else:
                        box = min(candy_dict[i],candy_dict[k-i])
                        candy_dict[i] -= box
                        candy_dict[k-i] -= box
                    boxes += box

    print(2*boxes)
    

main()


n,k=list(map(int,input().split()))
a=[int(x)%k for x in input().split()]
f={}
an=0
for i in a:
    if -i in f and f[-i]>0:
        an+=2
        f[-i]-=1
    elif k-i in f and f[k-i]>0:
        an+=2
        f[k-i]-=1
    else:
        if i not in f:f[i]=0
        f[i]+=1
print(an)


n, k = list(map(int, input().split()))
d = list(map(int, input().split()))
ost = [0] * k
for i in range(n):
    ost[d[i] % k] += 1
ans = ost[0] // 2
for i in range(1, k // 2 + 1):
    if i != k - i:
        ans += min(ost[i], ost[k - i])
    else:
        ans += ost[i] // 2
print(ans * 2)


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

div = [0 for i in range(k)]

for i in candies:
    div[i % k] += 1


res = (div[0] // 2)*2
if k % 2 == 1:
    c = k//2 +1
else:
    c = k//2 + 1
for i in range(1, c):
    res += 2 * min(div[i], div[k - i]) if i != k - i else (div[i] // 2)*2
print(res)

n,k = list(map(int,input().split()))
num = list(map(int,input().split()))
gay = []
for i in num:
	gay.append(i%k)
number = [0] * 101
for i in gay:
	number[i] += 1
#print(number)
i = 0
chuj = 1
wynik = 0
while i<k:
	if i == (k-i)%k:
		if number[i] > 1:
			number[i] -= 2
			wynik += 1
		else:
			number[i] = 0
			i += 1
	else:
		if number[i] > 0:
			if number[(k-i)%k]>0:
				number[i] -= 1
				number[(k-i)%k] -= 1
				wynik += 1
			else:
				number[i] = 0
		if number[i] == 0:
			i += 1
print(2*wynik)