from sys import stdin
N,K = map(int, stdin.readline().split())
#ustding memois(z)ation
memo=dict()
nums = stdin.buffer.read( ).splitlines( )
for s in nums:
if s not in memo:
memo[s]=1
else:
memo[s] += 1
total=0
for key, value in memo.items():
if int(key)%K == 0:
total += value
print(total)
ZnJvbSBzeXMgaW1wb3J0IHN0ZGluCiAKTixLID0gbWFwKGludCwgc3RkaW4ucmVhZGxpbmUoKS5zcGxpdCgpKQogCiN1c3RkaW5nIG1lbW9pcyh6KWF0aW9uCm1lbW89ZGljdCgpCiAKbnVtcyA9IHN0ZGluLmJ1ZmZlci5yZWFkKCApLnNwbGl0bGluZXMoICkKIApmb3IgcyBpbiBudW1zOgogICAgaWYgcyBub3QgaW4gbWVtbzoKICAgICAgICBtZW1vW3NdPTEKICAgIGVsc2U6CiAgICAgICAgbWVtb1tzXSArPSAxCiAKdG90YWw9MApmb3Iga2V5LCB2YWx1ZSBpbiBtZW1vLml0ZW1zKCk6CiAgICBpZiBpbnQoa2V5KSVLID09IDA6CiAgICAgICAgdG90YWwgKz0gdmFsdWUKcHJpbnQodG90YWwpIA==