#include using namespace std; long long n, m, a, ans; map Mp; int main() { cin >> n >> m; for (int i = 0; i < n; i++) { cin >> a; Mp[a % m]++; } for (auto j : Mp) { long long t = j.first, u = j.second; if (t == 0 && u > 0) ans++; else { long long w = Mp[m - t]; if(u > w || (u == w && t <= m - t)) ans += u; } } cout << ans << endl; }