#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define ll long long #include #define mod % 1000000007 #define rep(i,n) for(long long i = 0;i < n;i ++) ll MAX = 5'000'000'000'000'000'000LL; using namespace std; int main(){ ll n,m; cin >> n >> m; map mp; for(int i = 0;i < n;i ++){ ll a; cin >> a; mp[a%m] ++; } ll ans = 0; for(auto [key,value]:mp){ if(key == 0 or key*2 == m){ ans ++; }else{ if(mp[m-key]key) ans += value; } } cout << ans << endl; return 0; }