Takahashi is playing with N cards.

The i-th card has an integer X_i on it.

Takahashi is trying to create as many pairs of cards as possible satisfying one of the following conditions:

* The integers on the two cards are the same.
* The sum of the integers on the two cards is a multiple of M.



Find the maximum number of pairs that can be created.

Note that a card cannot be used in more than one pair.

Constraints

* 2≦N≦10^5
* 1≦M≦10^5
* 1≦X_i≦10^5

Input

The input is given from Standard Input in the following format:


N M
X_1 X_2 ... X_N


Output

Print the maximum number of pairs that can be created.

Examples

Input

7 5
3 1 4 1 5 9 2


Output

3


Input

15 10
1 5 6 10 11 11 11 20 21 25 25 26 99 99 99


Output

6
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};

int main(){
	static int N;
	static int M;
	static int X[100010];
	scanf("%d",&N);
	scanf("%d",&M);
	for(int i = 1 ; i <= N ; i ++){
		scanf("%d",&X[i]);
	}
	
	static int cnt[100010] = {};
	for(int i = 1 ; i <= N ; i ++){
		cnt[X[i]] ++;
	}
	
	static int cnt_M[100010][2] = {};
	for(int i = 1 ; i <= 100000 ; i ++){
		cnt_M[i%M][0] += cnt[i]%2;
		cnt_M[i%M][1] += cnt[i]/2;
	}
	
	static int ret = 0;
	ret += cnt_M[0][0]/2;
	ret += cnt_M[0][1];
	if(M%2 == 0){
		ret += cnt_M[M/2][0]/2;
		ret += cnt_M[M/2][1];
	}
	for(int i = 1 ; i < M-i ; i ++){
		int a = min ( cnt_M[i][0] , cnt_M[M-i][0] );
		ret += a;
		cnt_M[i][0] -= a;
		cnt_M[M-i][0] -= a;
		while(cnt_M[i][0] >= 2 && cnt_M[M-i][1] >= 1){
			ret += 2;
			cnt_M[i][0] -= 2;
			cnt_M[M-i][1] -= 1;
		}
		while(cnt_M[M-i][0] >= 2 && cnt_M[i][1] >= 1){
			ret += 2;
			cnt_M[M-i][0] -= 2;
			cnt_M[i][1] -= 1;
		}
		ret += cnt_M[i][1];
		ret += cnt_M[M-i][1];
	}
	cout << ret << endl;
}

