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 <algorithm>
#include <iostream>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <iterator>
#include <map>
#include <set>
#include <iomanip>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
#define INF 100000000000
#define MAX 200001
#define MOD 1000000007  

int main(){
    ll N, M;
    cin >> N >> M;
    vector<int> X(N);
    vector<pair<int, int>> cards(M + 3,{0, 0});
    for(int i = 0; i < N; i++){
        cin >> X[i];
        cards[X[i] % M].first++;
    }
    sort(X.begin(), X.end());
    ll now = X[0];
    ll cnt = 1;
    for(int i = 1; i < N; i++){
        if(now == X[i]){
            cnt++;
            if(i == N - 1) cards[now % M].second += cnt /2;
        } 
        else{
            cards[now % M].second += cnt / 2;
            now = X[i];
            cnt = 1;
        }
    }
    ll ans = cards[0].first / 2;
    for(int i = 1; i < M / 2 + 1; i++){
        if(M % 2 == 0 && i == M / 2) break;
        int a = cards[i].first;
        int b = cards[M - i].first;
        if(a < b){
            int p = cards[M - i].second;
            while(true){
                if(p == 0 or b - 2 < a) break;
                ans++;
                p--;
                b -= 2;
            }
            ans += a;
        }
        else{
            int p = cards[i].second;
            while(true){
                if(p == 0 or a - 2 < b) break;
                ans++;
                p--;
                a -= 2;
            }
            ans += b;
        }
    }
    if(M % 2 == 0) ans += cards[M / 2].first / 2;
    cout << ans << endl;
}