Martin has just been hired as a computer administrator in a big company. The company did not change its authorization system since s. Every person has a four-digit personal identification number (). Nobody uses usernames or passwords, you can login just by typing your . As the company grew, they added the possibility to use letters as well, but the length of the remained the same.
Martin is not happy with the situation. Suppose there are people whose s differ only at a single place, for example and . If the first person accidentally presses instead of , the system would still let him in. Martin would like to make the statistics about the s currently in use, in particular, compute the number of pairs of s that differ at , , or positions. He hopes that these numbers will be alarming enough to convince his boss to invest in a better system.
Given the list of s and an integer , find the number of pairs of s that differ at exactly positions.
The first line of the input contains two space-separated positive integers and , where is the number of s and is the chosen number of differences. Each of the following lines contains a single .
Constraints
You may assume that in all test cases 2 \le N \le 50000 and 1 \le D \le 4.
Each is of length and each character is either a digit or a lowercase letter between '' and '', inclusive. You may assume that all s in the input are different.
In test cases worth points, N \le 2000.
In test cases worth points, D \le 2. Out of those, in test cases worth points, D = 1.
In test cases worth points, every will only consist of digits or lowercase letters between '' and '', inclusive. Thus it can be viewed as a hexadecimal number.
Output a single line with a single number: the number of pairs of s that differ at exactly positions.
Example 1