/** * @FileName a.cpp * @Author kanpurin * @Created 2022.06.11 02:20:52 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n;cin >> n; ll m;cin >> m; map mp; for (int i = 0; i < n; i++) { ll a;cin >> a; mp[a%m]++; } int ans = 0; for (auto p : mp) { if (p.first == 0) continue; if (mp.find(m-p.first) != mp.end()) { if (p.first>=m-p.first) continue; ans += max(p.second,mp[m-p.first]); } else { ans += p.second; } cerr << ans << " " << p.first << endl; } if (mp.find(0) != mp.end()) ans++; if (m%2==0&&mp.find(m/2)!=mp.end()) ans++; cout << ans << endl; return 0; }