Andrew is a very curious student who drew a circle with the center at (0, 0) and an integer circumference of C ≥ 3. The location of a point on the circle is the counter-clockwise arc length from the right-most point of the circle.

Andrew drew N ≥ 3 points at integer locations. In particular, the ith point is drawn at location Pi (0 ≤ Pi ≤ C − 1). It is possible for Andrew to draw multiple points at the same location.
A good triplet is defined as a triplet (a, b, c) that satisfies the following conditions:
Lastly, two triplets (a, b, c) and (a', b', c') are distinct if a ≠ a', b ≠ b', or c ≠ c'.
Andrew, being a curious student, wants to know the number of distinct good triplets. Please help him determine this number.
The first line contains the integers N and C, separated by one space.
The second line contains N space-separated integers. The ith integer is Pi (0 ≤ Pi ≤ C − 1).
Output the number of distinct good triplets.