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
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#ifdef int
const ll INF = (1LL<<60);
#else
const int INF = (1LL<<30);
#endif
const double PI = 3.14159265359;
const double EPS = 1e-12;
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

int x[100010], cnt[100010], cnt2[100010];
VI g[100010];
PII a[100010];
signed main(void)
{
  int n, m;
  cin >> n >> m;
  REP(i, n) {
    cin >> x[i];
    cnt[x[i]%m]++;
    g[x[i]%m].PB(x[i]);
  }
  REP(i, m) {
    if(g[i].size() == 0) continue;
    sort(ALL(g[i]));
    int c = 1;
    // for(int j: g[i]) cout << j << " "; cout << endl;
    FOR(j, 1, g[i].size()) {
      if(g[i][j] == g[i][j-1]) {
        c++;
      } else {
        a[i].first += c%2==1;
        a[i].second += c/2;
        c = 1;
      }
    }
    a[i].first += c%2==1;
    a[i].second += c/2;
  }
  // REP(i, m) cout << a[i].first << "," << a[i].second << " "; cout << endl;

  int ret = 0;
  REP(i, m/2+1) {
    if(i == 0 || i*2 == m) {
      ret += cnt[i]/2;
    } else {
      int tmp = min(cnt[i], cnt[m-i]);
      // cout << tmp << " ";
      ret += tmp;
      if(a[i].first >= tmp) ret += a[i].second;
      else ret += max(0LL, a[i].second - (tmp - a[i].first - 1)/2 - 1);
      if(a[m-i].first >= tmp) ret += a[m-i].second;
      else ret += max(0LL, a[m-i].second - (tmp - a[m-i].first - 1)/2 - 1);
    }
    // cout << i << " " << ret << endl;
  }
  cout << ret << endl;

  return 0;
}
