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 <bits/stdc++.h>
using namespace std;

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-6;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

const int64 mod = 1e9+7;

/*
int main(void){
	int32 N;
	cin >> N;
	vector<int64> v(N);
	REP(i, N) cin >> v[i];

	int64 maxi = 0;
	int64 res = 0;
	REP(i, N){
		int64 cnt = (v[i]-1)/(maxi+1);
		if(cnt){ res += cnt; chmax(maxi, 1); }
		else maxi = v[i];
	}
	cout << res << endl;
}
*/

int main(void){
	int32 N, M;
	cin >> N >> M;
	vector<int64> X(N), cnt(M, 0), same(M, 0);
	map<int64, int64> mp;
	REP(i, N){
		cin >> X[i];
		cnt[X[i]%M]++;
		mp[X[i]]++;
		if(mp[X[i]]%2 == 0){
			same[X[i]%M]+=2;
		}
	}
	int64 res = 0;
	for(int32 i = 0;i < M/2+1;i++){
		int64 maxi = min(cnt[i], cnt[(M-i)%M]);
		if(i == (M-i)%M) maxi /= 2;
		res += maxi;
		cnt[i] -= maxi; cnt[(M-i)%M] -= maxi;
		res += min(cnt[i], same[i])/2;
		if(i!=(M-i)%M) res += min(cnt[M-i], same[M-i])/2;
	}
	cout << res << endl;
}