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;

#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int,int> p;

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

#define MAX_N 100010

int N,M;
int X[MAX_N];
int cnt[MAX_N];
int cnt2[MAX_N];
int main(){
    ios::sync_with_stdio(false);
    cin >> N >> M;
    REP(i,N) {cin >> X[i];cnt[X[i]%M]++;cnt2[X[i]]++;}
    int ans = 0;
    ans=cnt[0]/2;
    cnt[0]-=(cnt[0]/2)*2;
    FOR(i, 1, M) {
        if (M-i<=i) break;
        int tmp=min(cnt[i],cnt[M-i]);
        ans+=tmp;
        cnt[i]-=tmp;
        cnt[M-i]-=tmp;
    }
    if(M%2==0) {
        int tmp=cnt[M/2]/2;
        ans+=tmp;
        cnt[M/2]-=tmp*2;
    }
    REP(i,N) {
        if (cnt2[X[i]]>1 && cnt[X[i]%M]>1) {
            int tmp = min(cnt2[X[i]],cnt[X[i]%M])/2;
            ans+=tmp;
            cnt2[X[i]]-=tmp*2;
            cnt[X[i]%M]-=tmp*2;
        }
    }
    
    cout << ans << endl;
    
    return 0;
}