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 <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x)     (x).begin(),(x).end()
# define UNIQ(c)    (c).erase(unique(ALL((c))), end((c)))
# define mp         make_pair
# define eb         emplace_back
# define FOR(i,a,b) for(int i=(a);i<(b);++i)
# define REP(i,n)   FOR(i,0,n)
# define INIT       std::ios::sync_with_stdio(false);std::cin.tie(0);

int n, m;
int x[101010];
int cnt1[101010];
int cnt2[101010]; 
int main() {
	cin >> n >> m;
	for (int i = 0; i < n;i++) cin >> x[i];

	map<int, int> mapp;
	for (int i = 0; i < n; i++)mapp[x[i]]++;

	for (auto p : mapp) {
		cnt1[p.first % m] += p.second;
		cnt2[p.first % m] += p.second / 2;
	}

	int ans = 0;

	for (int i = 0; i < m / 2 + 1; i++) {
		int j = m - i;

		if (i == 0 || i == j) {
			ans += cnt1[i] / 2;
		}
		else {
			if (cnt1[i] < cnt1[j]) {
				ans += cnt1[i];
				int d = cnt1[j] - cnt1[i];
				d = d / 2;
				ans += min(d, cnt2[j]);
			}
			else {
				ans += cnt1[j];
				int d = cnt1[i] - cnt1[j];
				d = d / 2;
				ans += min(d, cnt2[i]);
			}
		}
	}

	cout << ans << endl;
}