#include #define rep(i, n) for (int i = 0; i < (n); ++i) using std::cin; using std::cout; using std::min; using std::max; using std::set; using std::map; using std::vector; 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; rep(i, n) mp[a[i]]++; set s; rep(i, n) { int x = a[i]; int y = m-a[i]; s.insert(min(x, y)); } ll ans = 0; for (ll x : s) { int y = m-x; if (x == 0 or x == y) ans++; else ans += max(mp[x], mp[y]); } cout << ans << '\n'; return 0; }