#include #include #include #define rep(i,n) for(int i=0; i> N; i64 M; cin >> M; map> A; int t = 0; int s = 0; rep(i,N){ i64 a; cin >> a; a %= M; if(a == 0) t = 1; else if(a*2 == M) s = 1; else{ if(M-a < a) A[a].first++; else A[M-a].second++; } } for(auto a : A) t += max(a.second.first, a.second.second); cout << (t+s) << endl; return 0; }