#include using namespace std; using lint = long long; int main() { lint n, m; cin >> n >> m; vector vec(n); for (int i = 0; i < n; i++) cin >> vec[i]; map ma; for (int i = 0; i < n; i++) ma[vec[i]%m]++; lint ans = 0; for (auto pa : ma) { lint x = pa.first; lint y = pa.second; if (m-x == x) ans++; else if (ma.count(m-x)) { if (m-x < x) continue; else ans += max(y, ma.at(m-x)); } else ans += y; /* if (m-x == x) ans++; else if (m-x < x) break; else { if (ma.count(m-x)) { ans += max(ma.at(m-x), y); } } //*/ } cout << ans << endl; }