#include #define rep(i,n) for(int i = 0; i < (int)(n); i++) using namespace std; using LL = long long; int main(){ int N; LL M; cin >> N >> M; vector A(N); rep(i,N) cin >> A[i]; rep(i,N) A[i] %= M; map mp; map used; rep(i,N) mp[A[i]]++; int ans = 0; for(auto itr : mp){ LL a1 = itr.first; if(used[a1]) continue; LL a2 = (M - a1) % M; if(a1 == a2) ans++; else ans += max(mp[a1], mp[a2]); used[a1] = 1; used[a2] = 1; } cout << ans << endl; return 0; }