Let the number of numbers be \( n \), and their sum be \( S \). The arithmetic mean is given by:
\[
\frac{S}{n} = 40 \quad \Rightarrow \quad S = 40n.
\]
When each number is increased by 7, the new sum becomes:
\[
S + 7n = 40n + 7n = 47n.
\]
Then, multiplying the sum by 12:
\[
12 \times (S + 7n) = 12 \times 47n = 564n.
\]
Thus, the new mean is:
\[
\frac{12 \times (S + 7n)}{n} = \frac{564n}{n} = 564.
\]