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>

using namespace std;
typedef unsigned int uint;
typedef long long int ll;
typedef unsigned long long int ull;

#define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout<<e<<" ";}cout<<endl;
#define debugm(m) printf("L%d %s is..\n",__LINE__,#m);for(auto v:m){for(auto e:v){cout<<e<<" ";}cout<<endl;}
#define debuga(m,w) printf("L%d %s is => ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout<<endl;
#define debugaa(m,w,h) printf("L%d %s is..\n",__LINE__,#m);for(int y=0;y<(h);y++){for(int x=0;x<(w);x++){cout<<(m)[x][y]<<" ";}cout<<endl;}
#define ALL(v) (v).begin(),(v).end()
#define BIGINT 0x7FFFFFFF
#define E107 1000000007
void printbit(int u){if(u==0)cout<<0;else{int s=0,k=0;for(;0<u;u>>=1,k++)s=(s<<1)|(u&1);for(;0<k--;s>>=1)cout<<(s&1);}}

#define TIME chrono::system_clock::now()
#define MILLISEC(t) (chrono::duration_cast<chrono::milliseconds>(t).count())

template<typename T1,typename T2>
ostream& operator <<(ostream &o,const pair<T1,T2> p){o<<"("<<p.first<<":"<<p.second<<")";return o;}


int mood[101010];
map<int,int> moodset[101010];

int mm,nn,aa;

int main(){
    int i,j,k;
    int x,y;
    int u,s;
    
    cin >> nn >> mm;
    
    for (i=1;i<=nn;i++){
        scanf("%d",&x);
        mood[x%mm]++;
        moodset[x%mm][x]++;
    }
    //debuga(mood,mm)
    int result = 0;
    for (i=1;i<(mm+1)/2;i++){
        j = mm-i;
        k = min(mood[i],mood[j]);
        //printf("%d  %d %d %d  %d\n",i,mood[j],mood[i],k,result);
        result += k;
        
        u = mood[i] > mood[j] ? i : j;
        s = 0;
        for (auto p : moodset[u]){
            s+=p.second/2;
        }
        result+=min((mood[u]-k)/2,s);
        
        // mood[i]-=k;
        // mood[j]-=k;
        // result+=mood[i]/2 + mood[j]/2;
    }
    
    if (mm%2==0){
        result+=mood[mm/2]/2;
    }
    result+=mood[0]/2;
    
    cout << result << endl;
    
    return 0;
}