3. The Atelier "Heavy Burden" purchased a large batch of cast iron buttons. If they sew two buttons on each coat or if they sew three buttons on each coat, in each case 1 piece will remain from the entire batch. If, however, they sew four buttons on each coat or if they sew five buttons on each coat, in each case 3 pieces will remain from the entire batch. How many buttons will remain if they sew twelve buttons on each coat?
# Solution

Let $a$ be the desired number. From the condition, it follows that the number $a-1$ is divisible by 2 and 3. Therefore, $a=6k+1$. Also, the number $a-3$ is divisible by 4 and 5. Therefore, $a=20n+3$. We solve the equation

$$
6k+1=20n+3
$$

Or, equivalently,

$$
3k=10n+1
$$

Its general solution is

$$
k=7+10s, \quad n=2+3s, \quad \Rightarrow \quad a=60s+43
$$

We find the remainder of the division of $a$ by 12. Since 60 is divisible by 12, the desired remainder is the remainder of the division of 43 by 12, which is 7.

Answer: 7.