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<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = 998244353;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
int cnt[100001] = {};
int main() {
	int n, m; cin >> n >> m;
	rep(i, n) {
		int a; cin >> a; cnt[a]++;
	}
	int out = 0;
	rep(i, 100001) {
		if (cnt[i] % 2) {
			bool f = false;
			for (int j = m - i%m; j <= 100000; j += m) {
				if (i == j)continue;
				if (cnt[j] % 2) {
					cnt[j]--; cnt[i]--; out++; f = true; break;
				}
			}
			if (f)continue;
			for (int j = m - i % m; j <= 100000; j += m) {
				if (i == j)continue;
				if (cnt[j]) {
					cnt[j]--; cnt[i]--; out++; break;
				}
			}
		}
	}
	rep(i, 100001) {
		out += cnt[i] / 2;
	}
	cout << out << endl;
	return 0;
}