Problems
In order to improve their physical fitness, the cows have taken up gymnastics! Farmer John designates his favorite cow Bessie to coach the
In each of
Help Bessie compute the total number of consistent pairs.
Input
The first line of the input file contains two positive integers
Output
Output, on a single line, the number of consistent pairs.
Example
3 4
4 1 2 3
4 1 3 2
4 2 1 3
4
The consistent pairs of cows are