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
#ifdef LOCAL111
	#define _GLIBCXX_DEBUG
#else
	#define NDEBUG
#endif
#include <bits/stdc++.h>
const int INF = 1e9;
using namespace std;
template<typename T, typename U> ostream& operator<< (ostream& os, const pair<T,U>& p) { cout << '(' << p.first << ' ' << p.second << ')'; return os; }

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#ifdef LOCAL111
	#define DEBUG(x) cout<<#x<<": "<<(x)<<endl
	template<typename T> void dpite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
#else
	#define DEBUG(x) true
	template<typename T> void dpite(T a, T b){ return; }
#endif
#define F first
#define S second
#define SNP string::npos
#define WRC(hoge) cout << "Case #" << (hoge)+1 << ": "
template<typename T> void pite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}

typedef long long int LL;
typedef unsigned long long ULL;
typedef pair<int,int> P;
typedef pair<LL,LL> LP;

void ios_init(){
	//cout.setf(ios::fixed);
	//cout.precision(12);
#ifdef LOCAL111
	return;
#endif
	ios::sync_with_stdio(false); cin.tie(0);	
}

int main()
{
	ios_init();
	int n,m;
	while(cin >> n >> m){
		vector<int> x(n);
		int hoge = 0;
		REP(i,n){
			cin >> x[i];
			hoge = max(hoge,x[i]);
		}
		vector<int> cnt(hoge+1,0);
		REP(i,n){
			cnt[x[i]]++;
		}
		int ans = 0;
		vector<int> mv(m,0);
		vector<int> mv2(m,0);
		REP(i,SZ(cnt)){
			mv[i%m] += cnt[i];
			mv2[i%m] += cnt[i]/2;
		}
		dpite(ALL(mv));
		dpite(ALL(mv2));
		FOR(i,1,(m+1)/2){
			int t = min({max(mv[i]-2*mv2[i],mv[m-i]-2*mv2[m-i]),
						mv[i],mv[m-i]});
			DEBUG(i); DEBUG(t);
			ans += t;
			mv[i] -= t;
			mv[m-i] -= t;
			ans += min(2*mv2[i],mv[i])/2;
			ans += min(2*mv2[m-i],mv[m-i])/2;
		}
		ans += mv[0]/2;
		if(m%2 == 0){
			ans += mv[m/2]/2;
		}
		cout << ans << endl;
	}
	return 0;
}
