from collections import defaultdict n,m = map(int,input().split()) a = list(map(int,input().split())) a = [num%m for num in a] d = defaultdict(int) for num in a: d[num] += 1 ans = 0 for num in a: if num != 0: ans += max(d[num],d[m-num]) d[num] = 0 d[m-num] = 0 if 0 in a: ans += 1 print(ans)