typedef long long ll; typedef long double ld; #include using namespace std; #define int long long signed main(){ ll n,m; std::cin >> n>>m; map used; ll ans = 0; for (int i = 0; i < n; i++) { ll a; std::cin >> a; used[a%m]++; } map u; for (auto e : used) { if(e.first*2%m==0){ ans++; u[e.first]=true; }else{ if(!u[e.first]){ ans += max(used[e.first],used[m-e.first]); u[e.first]=true; u[m-e.first]=true; } } } std::cout << ans << std::endl; }