I. Make Them Happy
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given an array $$$A$$$ consisting of $$$N$$$ positive integers, and a positive integer $$$X$$$.

Count the number of pairs of integers $$$(i, j)$$$ ($$$1 \le i \lt j \le N$$$) that satisfy the following:

  • $$$A_i + A_j$$$ must be divisible by $$$X$$$.
  • $$$A_i \cdot A_j$$$ must be divisible by $$$X$$$.
Input

The first line of the input contains two space-separated integers $$$N$$$ and $$$X$$$ ($$$1 \le N \le 10^6$$$, $$$1 \le X \le 10^6$$$) — the length of the array $$$A$$$ and the value of $$$X$$$, respectively.

The second line of the input consists of $$$N$$$ space-separated integers $$$A_1, A_2, \dots, A_N$$$ ($$$1 \le A_i \le 10^6$$$).

Output

Output one line containing a single integer — the number of pairs $$$(i, j)$$$ such that both $$$A_i + A_j$$$ and $$$A_i \cdot A_j$$$ are divisible by $$$X$$$.

Examples
Input
3 2
2 2 3
Output
1
Input
4 2
2 4 6 3
Output
3