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>
#define rep(i,n) for(size_t i=0;i<(size_t)(n);i++)
#define rrep(i,n) for(size_t i=(size_t)(n)-1;i>=0;i--)
#define each(a,x) for(auto a : (x))
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) ((a) = min((a),(b)))
#define chmax(a,b) ((a) = max((a),(b)))
#define in_range(x,l,r) ((l)<=(x) && (x)<(r))
#define printvec(a) rep(i,a) cout << a[i] << " \n"[i+1==(a).size()];
#define fs first
#define sc second
#define em emplace
#define eb emplace_back
#define sz size()
#define MP make_pair
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;

const ll INF = 1e8;
const D EPS = 1e-8;
const ll MOD = 1e9+7;

inline int sum(const map<int,int>& b){
  int sum = 0;
  for(auto p : b) sum += p.second;
  return sum;
}

int main(){
  int n,m;
  cin >> n >> m;
  vector< map<int,int> > bucket(m);
  rep(i,n){
    int x;
    cin >> x;
    bucket[x%m][x]++;
  }

  int ans = 0;
  for(int i=1;i<(m+1)/2;i++){
    int idx_a = i, idx_b = m-i;
    int num_a = sum(bucket[idx_a]), num_b = sum(bucket[idx_b]);
    if(num_a > num_b){
      swap(idx_a, idx_b); swap(num_a, num_b);
    }

    ans += num_a;
    int self_pair = 0;
    for(auto p : bucket[idx_b]) self_pair += p.second/2;
    ans += min((num_b-num_a)/2, self_pair);
  }

  ans += sum(bucket[0])/2;
  if(m%2==0) ans += sum(bucket[m/2])/2;

  cout << ans << endl;
}
