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 <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define iREP(i,Itr) for(auto (i)=(Itr).begin();(i)!=(Itr).end();(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

int main(){
    
    int N,M; cin>>N>>M;
    vector<int> X(N);
    REP(i,N)cin>>X[i];
    
    sort(X.begin(),X.end());
    
    map<int,int> cnt_pair;
    map<int,int> cnt;
    
    int t=0,pre=X[0];
    REP(i,N){
        if(cnt.find(X[i]%M)==cnt.end())cnt[X[i]%M]=1;
        else cnt[X[i]%M]++;
        if(pre==X[i]){
            t++;
            if(i==N-1){
                if(cnt_pair.find(pre%M)==cnt_pair.end())cnt_pair[pre%M]=t/2;
                else cnt_pair[pre%M]+=t/2;
                pre=X[i];
                t=1;
            }
        }else{
            if(cnt_pair.find(pre%M)==cnt_pair.end())cnt_pair[pre%M]=t/2;
            else cnt_pair[pre%M]+=t/2;
            pre=X[i];
            t=1;
        }
    }
    
    ll ans=cnt[0]/2;
    
    if(M%2==0){
        ans+=cnt[M/2]/2;
        for(int i=1;i<M/2;i++){
            int mul=min(cnt[M-i],cnt[i]);
            int pt=min(cnt_pair[M-i],(cnt[M-i]-mul)/2)+min(cnt_pair[i],(cnt[i]-mul)/2);
            ans+=mul+pt;
        }
    }else{
        for(int i=1;i<=M/2;i++){
            int mul=min(cnt[M-i],cnt[i]);
            int pt=min(cnt_pair[M-i],(cnt[M-i]-mul)/2)+min(cnt_pair[i],(cnt[i]-mul)/2);
            ans+=mul+pt;
        }
    }
    
    cout<<ans<<endl;
    
    return 0;
}
