Given the finite multi-set $A$ of $n$ pairs of integers, an another finite multi-set $B$ of $m$ triples of integers, we define the product of $A$ and $B$ as a multi-set
$C =A * B \\
= \{\langle a,c,d\rangle \mid \langle a,b\rangle\in A,~\langle c,d,e\rangle\in B~and~b=e\}$
For each $\langle a,b,c\rangle\in C$, its BETTER set is defined as
$BETTER_C(\langle a,b,c\rangle) = \\
\{ \langle u,v,w\rangle\in C \mid \langle u,v,w\rangle \neq \langle a,b,c\rangle,~u\ge a,~v\ge b,~w\ge c \}$
As a \textbf{multi-set} of triples, we define the TOP subset (as a multi-set as well) of $C$, denoted by $TOP(C)$, as
$TOP(C) = \{ \langle a,b,c\rangle\in C \mid BETTER_C(\langle a,b,c\rangle) = \emptyset \}$
You need to compute the size of $TOP(C)$.