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$.
[{"code": "n, k = map(int, input().split())\nD = list(map(int, input().split()))\nz = {i: 0 for i in range(k)}\nfor i in range(n):\n    z[D[i] % k] += 1\ncnt = z[0] // 2\nfor q in range(1, k // 2 + k % 2):\n    cnt += min(z[q], z[k - q])\nif k % 2 == 0:\n    cnt += z[k // 2] // 2\nprint(cnt * 2)", "passed": true, "time": 0.16, "memory": 14124.0, "status": "done"}, {"code": "n, k = map(int, input().split())\nd = list(map(int, input().split()))\n\ncount = [0] * k\nfor x in d:\n    count[x%k] += 1\n\nresult = count[0]//2\nfor i in range(1, k):\n    if i*2 >= k:\n        break\n    result += min(count[i], count[k-i])\n\nif k%2==0:\n    result += count[k//2]//2\nprint(result*2)", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\ncounts = [0] * k\nfor i in map(int, input().split()):\n    counts[i % k] += 1\n\nc = counts[0] // 2\nfor i in range(1, k):\n    if 2 * i >= k:\n        break\n    c += min(counts[i], counts[k - i])\nif k % 2 == 0:\n    c += counts[k // 2] // 2\n\nprint(2 * c)\n", "passed": true, "time": 0.83, "memory": 14240.0, "status": "done"}, {"code": "def main():\n    n, k = list(map(int, input().split()))\n    cnt = [0] * k\n    ans = 0\n    arr = list(map(int, input().split()))\n    for el in arr:\n        t = el % k\n        if (cnt[(k - t) % k] > 0):\n            cnt[(k - t) % k] -= 1\n            ans += 2\n        else:\n            cnt[t] += 1\n    print(ans)\n \n \nmain()\n", "passed": true, "time": 0.83, "memory": 14224.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\n\nans = [0] * k\n\na = list(map(int, input().split()))\n\nfor c in a:\n\tans[c % k] += 1\nkol = ans[0] - ans[0] % 2\nfor i in range(1, int(k / 2 + 0.5)):\n\tkol += min(ans[i], ans[k - i]) * 2\n\t#print(ans[i], ans[k - i], i)\n\nif k % 2 == 0:\n\tkol += ans[k // 2] - ans[k // 2] % 2\n#print(ans)\nprint(kol)\n", "passed": true, "time": 0.17, "memory": 14212.0, "status": "done"}, {"code": "n, k = list(map(int,input().split()))\ndi = list(map(int,input().split()))\nai  = [0] * k\nfor i in di:\n    ai[i % k] += 1\nans = ai[0] // 2\nai[0] = 0\nfor i in range(1,k):\n    num = i\n    num2 = k - i\n    if num != num2:\n        ans += min(ai[num], ai[num2])\n    else:\n        ans += ai[num] // 2\n    ai[num] = 0\n    ai[num2] = 0\nprint(ans * 2)\n", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nd = list(map(int, input().split()))\ndi = dict()\nfor i in range(n):\n    if d[i] % k in di:\n        di[d[i] % k] += 1\n    else:\n        di[d[i] % k] = 1\nans = 0\nif 0 in di:\n    ans = di[0] // 2\nfor i in range(1, k // 2 + 1):\n    if i in di and k - i in di:\n        if i == k - i:\n            ans += di[i] // 2\n        else:\n            ans += min(di[i], di[k - i])\nprint(ans * 2)\n", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "n,k = [int(x) for x in input().split()]\n\nL = [int(x) for x in input().split()]\n\nD = [0]*k\n\nfor i in L:\n    D[i%k] += 1\n    \ns = 0    \nfor i in range((k+2)//2):\n    if i == 0:\n        s += 2*(D[0]//2)\n    elif (k%2 == 0) and (i == k//2):\n        s += 2*(D[i]//2)\n    else:\n        s += 2*min(D[i],D[k-i])\n    \nprint(s)", "passed": true, "time": 0.16, "memory": 14160.0, "status": "done"}, {"code": "n,k=map(int,input().split())\nd=[*map(int,input().split())]\ncnt=[0]*k\nfor i in d:\n    cnt[i%k]+=1\nans=cnt[0]//2\nfor i in range(1,k):\n    req=k-i\n    if i<req:\n        ans+=min(cnt[i],cnt[req])\n    elif i==req:\n        ans+=cnt[i]//2\nprint(ans*2)", "passed": true, "time": 0.16, "memory": 14240.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\na = list(map(int, input().split()))\nd = [0] * k\nfor i in range(n):\n    d[a[i] % k] += 1\n\nnum = 0\nfor i in range(k):\n    if k - i < i:\n        break\n    if i == 0:\n        num += d[i] // 2\n    elif i == k - i:\n        num += d[i] // 2\n    else:\n        num += min(d[i], d[k - i])\n\nprint(num * 2)\n", "passed": true, "time": 0.18, "memory": 14152.0, "status": "done"}, {"code": "from collections import Counter as C\nn, k = map(int, input().split())\nl = [int(x) % k for x in input().split()]\nc = C(l)\nres = 0\nfor i in range(k):\n    j = -i % k\n    vi, vj = c.get(i, 0), c.get(j, 0)\n    if i == j:\n        res += vi // 2\n    else:\n        res += min(vi, vj)\n    c[i] = 0\nprint(res * 2)", "passed": true, "time": 0.24, "memory": 14224.0, "status": "done"}, {"code": "n, K = map(int, input().split())\narr = map(int, input().split())\nfreq = [0 for _ in range(K)]\nfor x in arr:\n    freq[x%K] += 1\nans = 2*(freq[0]//2)\nfor i in range(1, K):\n    if i < K-i:\n        ans += 2*(min(freq[i], freq[K-i]))\n    elif i == K-i:\n        ans += 2*(freq[i]//2)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "n,k = list(map(int,input().split()))\nl   = list(map(int,input().split()))\n\nd = {}\n\nfor i in range(k):\n    d[i] = 0\n\nfor i in range(len(l)):\n    l[i] = l[i]%k\n    d[l[i]] += 1 \n\ns = 0\n\ns += d[0]//2\n\nfor i in range(1,k//2):\n    s += min(d[i],d[k-i])\n\nif k % 2 == 0:\n    s += d[k//2] // 2\nelse:\n    if k != 1:\n        s += min(d[k//2],d[k-k//2])\n        \nprint(s*2)\n", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\nD=list(map(int,input().split()))\n\nD2=[d%k for d in D]\n\nfrom collections import Counter\nc=Counter(D2)\n\nANS=c[0]//2*2\nif k%2==0:\n    ANS+=c[k//2]//2*2\nfor i in range(1,-(-k//2)):\n    ANS+=min(c[i],c[k-i])*2\n\nprint(ANS)\n    \n", "passed": true, "time": 0.24, "memory": 14124.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n# @Time    : 2019/3/7 23:13\n# @Author  : LunaFire\n# @Email   : gilgemesh2012@gmail.com\n# @File    : B. Preparation for International Women's Day.py\n\nfrom collections import Counter\n\n\ndef main():\n    n, k = map(int, input().split())\n    d = list(map(int, input().split()))\n\n    counter = Counter()\n    for x in d:\n        counter[x % k] += 1\n\n    ret = counter[0] // 2 * 2\n    for i in range(1, k):\n        if i != k - i:\n            ret += min(counter[i], counter[k - i])\n        else:\n            ret += counter[i] // 2 * 2\n    print(ret)\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\n\na = list(map(int, input().split()))\n\ndivs = {}\nhandled = [False, ] * k\n\nfor x in a:\n    divs[x % k] = divs.get(x % k, 0) + 1\n\nresult = divs.get(0, 0) - divs.get(0, 0) % 2\n\nfor i in range(1, k):\n    if not handled[i] and not handled[k - i]:\n        if i != k - i:\n            result += 2 * min(divs.get(i, 0), divs.get(k - i, 0))\n        else:\n            result += divs.get(i, 0) - divs.get(i, 0) % 2\n        handled[i] = handled[k - i] = True\n\nprint(result)\n", "passed": true, "time": 0.24, "memory": 14368.0, "status": "done"}, {"code": "#map(int,input().split())\n#int(input())\nn,k=map(int,input().split())\na=list(map(int,input().split()))\nd = dict()\nfor i in range(n):\n    m=a[i]%k\n    if m not in d:\n       d[m]=1\n    else:\n        d[m]+=1\nans=0\nif 0 in d:\n   ans = d[0]//2\nh=k//2\nif k%2==0 and h in d:\n    ans  += d[h]//2\nfor i in range(1,(k+1)//2):\n    if i in d and k-i in d:\n       ans += min(d[i],d[k-i])\nprint(ans*2)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "from math import floor\nfrom collections import defaultdict\n\nn, k = map(int, input().split())\na = defaultdict(int)\nfor i in input().split():\n    i = int(i) % k\n    a[i] += 1\nr = 0\nfor i in range(floor(k / 2) + 1):\n    if i == 0 or i == k - i:\n        r += a[i] // 2\n    else:\n        r += min(a[i], a[k - i])\nprint(r * 2)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n,k=tuple(map(int,input().strip().split(\" \")))\nnumbers=tuple(map(int,input().strip().split(\" \")))\nl=[]\nfor i in range(k):\n    l.append(0)\nfor i in numbers:\n    l[i%k]+=1\ns=(l[0]//2)*2\nimport math\nfor g in range(1,math.ceil(k/2)):\n    s=s+(min(l[g],l[k-g])*2)\nif(k%2==0):\n    s=s+((l[k//2]//2)*2)\nprint(s)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "def main():\n    n,k = list(map(int,input().split()))\n    candy = list(map(int,input().split()))\n    candies = []\n    zeroes = 0\n    for i in candy:\n        mod = i%k\n        if mod == 0:\n            zeroes += 1\n        else:\n            candies.append(mod)\n\n    candies.sort()\n\n    boxes = zeroes//2\n\n    candy_dict = {}\n\n    for i in candies:\n        if i not in list(candy_dict.keys()):\n            candy_dict[i] = 1\n        else:\n            candy_dict[i] += 1\n\n    #print (candy_dict)\n    for i in candy_dict:\n        if candy_dict[i] > 0:\n            if (k-i) in list(candy_dict.keys()):\n                if candy_dict[k-i] > 0:\n                    if i == (k-i):\n                        box = candy_dict[i]//2\n                        candy_dict[i] = candy_dict[i]%2\n                    else:\n                        box = min(candy_dict[i],candy_dict[k-i])\n                        candy_dict[i] -= box\n                        candy_dict[k-i] -= box\n                    boxes += box\n\n    print(2*boxes)\n    \n\nmain()\n", "passed": true, "time": 0.19, "memory": 14156.0, "status": "done"}, {"code": "n,k=list(map(int,input().split()))\na=[int(x)%k for x in input().split()]\nf={}\nan=0\nfor i in a:\n    if -i in f and f[-i]>0:\n        an+=2\n        f[-i]-=1\n    elif k-i in f and f[k-i]>0:\n        an+=2\n        f[k-i]-=1\n    else:\n        if i not in f:f[i]=0\n        f[i]+=1\nprint(an)\n", "passed": true, "time": 0.13, "memory": 14100.0, "status": "done"}, {"code": "n, k = list(map(int, input().split()))\nd = list(map(int, input().split()))\nost = [0] * k\nfor i in range(n):\n    ost[d[i] % k] += 1\nans = ost[0] // 2\nfor i in range(1, k // 2 + 1):\n    if i != k - i:\n        ans += min(ost[i], ost[k - i])\n    else:\n        ans += ost[i] // 2\nprint(ans * 2)\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "n, k = map(int, input().split())\ncandies = list(map(int, input().split()))\n\ndiv = [0 for i in range(k)]\n\nfor i in candies:\n    div[i % k] += 1\n\n\nres = (div[0] // 2)*2\nif k % 2 == 1:\n    c = k//2 +1\nelse:\n    c = k//2 + 1\nfor i in range(1, c):\n    res += 2 * min(div[i], div[k - i]) if i != k - i else (div[i] // 2)*2\nprint(res)", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "n,k = list(map(int,input().split()))\nnum = list(map(int,input().split()))\ngay = []\nfor i in num:\n\tgay.append(i%k)\nnumber = [0] * 101\nfor i in gay:\n\tnumber[i] += 1\n#print(number)\ni = 0\nchuj = 1\nwynik = 0\nwhile i<k:\n\tif i == (k-i)%k:\n\t\tif number[i] > 1:\n\t\t\tnumber[i] -= 2\n\t\t\twynik += 1\n\t\telse:\n\t\t\tnumber[i] = 0\n\t\t\ti += 1\n\telse:\n\t\tif number[i] > 0:\n\t\t\tif number[(k-i)%k]>0:\n\t\t\t\tnumber[i] -= 1\n\t\t\t\tnumber[(k-i)%k] -= 1\n\t\t\t\twynik += 1\n\t\t\telse:\n\t\t\t\tnumber[i] = 0\n\t\tif number[i] == 0:\n\t\t\ti += 1\nprint(2*wynik)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}]