3. On a plane, there are 8 lines, 3 of which are parallel, and any two of the remaining five intersect. We consider all triangles with sides lying on these lines. What is the greatest and the least number of such triangles that can be found?
Solution. Let's introduce the notation: $P$ - the set of parallel lines, $p_{k}, k=1,2, \ldots, m$ - any line from $P$; $Q$ - the set of non-parallel lines, $q_{j}, j=1,2, \ldots, n$ - any line from $Q$. The maximum possible number of triangles is associated with such an arrangement of lines from $Q$ where no three of them pass through the same point (maximum number of vertices). Then the number of triangles that do not have vertices on lines from $P$ is $C_{m}^{3}$. The number of triangles, one side of which lies on a line from $P$ is $n \cdot C_{m}^{2}$. Two sides of a triangle lying on two lines from $P$ do not exist due to their parallelism. Thus,

$$
N_{\max }=C_{n}^{3}+m C_{n}^{2}=\frac{n(n-1)(n-2)}{6}+m \frac{n(n-1)}{2}=\frac{n(n-1)}{6}(n+3 m-2)
$$

The minimum possible number of triangles is associated with such an arrangement of lines from $Q$ where all lines $q_{j}$ pass through one point $A$. If $A$ does not belong to any of the lines $p_{k}, k=1,2, \ldots, m$, then the number of triangles is $N_{1}=m C_{n}^{2}$. If $A \in p_{k}$, then the number of the desired triangles is $N_{2}=(m-1) C_{n}^{2}$. Thus,

$$
N_{\min }=(m-1) C_{n}^{2}=\frac{(m-1) n(n-1)}{2}
$$

In our case $m=3, n=5$, and therefore $N_{\max }=40$, and $N_{\text {min }}=20$.

Answer: $N_{\max }=40, N_{\min }=20$.