Set
In the popular card game SET, the player’s goal is to identify a certain triplet of cards with some special properties, called a set. Each card shows some figures, which differ in number, shape, transparency and color.
Marin and Josip have recently bought a deck of these cards and now they can’t stop playing. They’ve become so skilled at noticing sets that it soon became boring that the cards are determined by only four properties. Thus, they have decided to have fun with a generalized version of the game.
At their disposal is a deck of different cards. Each card is represented by a sequence of characters, each being one of , or . The order of the cards in the deck does not matter.
An unordered triplet of cards is called a set if for each of the positions, the three characters corresponding to the three cards are either the same or pairwise different. For example, three cards represented by , and make a set because all of the characters in the first and third positions are the same ( and respectively), and the characters in the second and fourth positions are different (, and in some order).
While looking at these cards on the table, they started to wonder: how many unordered triplets of these cards make a set. Write a program which will answer their question.
Input
The first line contains the integers and (, ) - the number of cards in the deck and the number of properties of a single card, respectively.
Each of the following lines contains a sequence of characters representing a card. Each character is one of , or . Different lines contain different sequences of characters.
Output
In the only line, print the number of unordered triplets which form a set.