SOLUTION. First, we will rearrange the left side of the given equation

$$
\begin{aligned}
a+a b+a b c+a c+c & =a(1+b)+a c(1+b)+c=a(1+b)(1+c)+c= \\
& =a(1+b)(1+c)+(1+c)-1=(1+c)(a(1+b)+1)-1,
\end{aligned}
$$

thanks to which we obtain the equivalent equation

$$
(1+c)(a(1+b)+1)=2018 .
$$

The number 2018 can be written as a product of two numbers in two ways: $1 \cdot 2018$ or $2 \cdot 1009$. Since $1+c \geq 2$ and $a(1+b)+1 \geq 3$, it can only be $1+c=2$ and $a(1+b)+1=1009$, so $c=1$ and $a(1+b)=1008$. In every suitable triplet $(a, b, c)$, $c=1$, and thus we are actually looking for the number of pairs $(a, b)$ satisfying the equation at the end of the previous sentence.

The number $1008=2^{4} \cdot 3^{2} \cdot 7$, which is to equal $a(1+b)$, has $5 \cdot 3 \cdot 2=30$ different divisors including one and itself. Since $1+b \geq 2$, $a$ cannot be 1008. For each of the other 29 divisors of 1008, we get one pair of solutions $(a, b)$.

Answer. The number of sought triplets is 29.

GUIDING PROBLEMS:

N1. Determine the number of divisors of the number 2016. $6 \cdot 3 \cdot 2=36$ divisors]

N2. Determine all pairs of natural numbers $a, b$ for which $a+a b+b=2017$. $[(a, b)=(1,1008),(a, b)=(1008,1)]$

N3. Find all pairs of non-negative integers $a, b$ for which $a^{2}+b+2=a+b^{2}$. $[59-\mathrm{C}-\mathrm{S}-3,(a, b)=(1,2),(a, b)=(0,2)]$

N4. Find all triples of integers $x, y, z$ for which

$$
\begin{array}{r}
x+y z=2005, \quad y+x z=2006 \\
{[54-\mathrm{C}-\mathrm{S}-1,(x, y, z)=(669,668,2),(x, y, z)=(2005,2006,0)]}
\end{array}
$$
4. Determine the number of all triples of natural numbers $a, b, c$, for which

$$
a + ab + abc + ac + c = 2017 \text{.}
$$