#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n; long long m; cin >> n >> m; map cnt; for (int i = 0; i < n; i++) { long long x; cin >> x; cnt[x % m]++; } set vis; int ans = 0; for (auto [k, v] : cnt) { if (vis.find(k) != vis.end()) continue; if (k == 0) { ans++; } else if (2 * k == m) { ans++; } else { long long x = m - k; if (cnt.find(x) != cnt.end()) { ans += max(v, cnt[x]); } else { ans += v; } vis.insert(x); } vis.insert(k); } cout << ans << endl; }