12. A set $S$ consists of several triangles, each with three side lengths that are integers less than 5, and no two triangles are congruent or similar. The maximum number of elements in set $S$ is ( ).
(A) 8
(B) 9
(C) 10
(D) 11
(E) 12
12. B.

Take any triangle from the set $S$, and let its three sides be $a$, $b$, and $c$ (assuming $a \leqslant b \leqslant c$), and $a+b>c$. Moreover, no two triangles are congruent or similar. Enumeration yields:
$$
\begin{array}{l}
(1,1,1),(1,2,2),(1,3,3), \\
(1,4,4),(2,2,3),(2,3,3), \\
(2,3,4),(3,3,4),(3,4,4),
\end{array}
$$

a total of 9 types.
$$
\text { Therefore, }|S|=9 \text {. }
$$