from collections import Counter def main(): N, M = map(int, input().split()) set_ = list(map(int, input().split())) modulo_list = map(lambda num: num % M, set_) modulo_counter = Counter(modulo_list) element_sum = 0 if modulo_counter[0] > 0: element_sum += 1 if M % 2 == 0 and modulo_counter[M // 2] > 0: element_sum += 1 for num in range(1, (M+1)//2): if modulo_counter[num] > modulo_counter[M-num]: element_sum += modulo_counter[num] else: element_sum += modulo_counter[M-num] print(element_sum) if __name__ == "__main__": main()