output_description: Print the maximum number of pairs that can be created.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N M
      X_1 X_2 ... X_N
attempt: if __name__ == "__main__":
      n, m = map(int, input().split(" "))
      x = list(map(int, input().split(" ")))
      x_mod = list(map(lambda x: x % m, x))
      s = [set() for _ in range(m)]
      num = [0 for _ in range(m)]
      pair = [0 for _ in range(m)]
      dic = dict()
      sum = 0
      sum_h = 0
      for i in range(n):
          s[x_mod[i]].add(x[i])
          num[x_mod[i]] += 1
          if str(x[i]) in dic.keys():
              dic[str(x[i])] += 1
          else:
              dic[str(x[i])] = 0
          if x_mod[i] == 0:
              sum += 0.5
          if m % 2 == 0 and x_mod[i] == m / 2:
              sum_h += 0.5
      for i in range(1, m):
          if i == m / 2:
              continue
          for j in range(len(s[i])):
              pair[i] += dic[str(list(s[i])[j])] / 2
  
      sum = int(sum)
      sum_h = int(sum_h)
      sum += sum_h
      for i in range(1, int((m + 1) / 2)):
          i_1 = i
          i_2 = m - i
          if num[i] > num[m - i]:
              i_1 = m - i
              i_2 = i
          sum += num[i_1]
          sum += min((num[i_2] - num[i_1]) / 2, pair[i_2])
      print(int(sum))
  
problem_description: Statement
  
  Takahashi is playing with N cards.
  
  The i-th card has an integer X_i on it.
  
  Takahashi is trying to create as many pairs of cards as possible satisfying
  one of the following conditions:
  
    * The integers on the two cards are the same.
    * The sum of the integers on the two cards is a multiple of M.
  
  Find the maximum number of pairs that can be created.
  
  Note that a card cannot be used in more than one pair.
samples: [{"input": "7 5\n    3 1 4 1 5 9 2", "output": "3\n    \n\nThree pairs (3,2), (1,4) and (1,9) can be created.\n\nIt is possible to create pairs (3,2) and (1,1), but the number of pairs is not\nmaximized with this.\n\n* * *"}, {"input": "15 10\n    1 5 6 10 11 11 11 20 21 25 25 26 99 99 99", "output": "6"}]