Species A can eat a species-B creature only if it is strictly larger. Given the sizes of $N$ A-creatures and $M$ B-creatures, count the pairs $(a, b)$ with $a > b$.
Input
Line 1: $N$ $M$. Line 2: $N$ sizes of A. Line 3: $M$ sizes of B.
Output
Print the number of edible pairs.
Example 1
Input
5 3 8 1 7 3 1 3 6 1
Output
7
Example 2
Input
3 4 2 13 7 103 11 290 215
Output
1
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.