5. Each face of a $1000 \times 1000 \times 1000$ cube is divided into $1000^{2}$ unit squares. How many squares can be colored black at most, so that no two black squares share a common edge?
5. The maximum number of blackened cells is
$$
3 \times 1000^{2}-2000=2998000 \text {. }
$$

First, consider any coloring method that meets the requirements of the problem.
As shown in Figure 2, divide the grid into concentric strips surrounding each vertex, with 500 strips surrounding each of the 8 vertices (one strip is shaded gray in Figure 2).

In the $k$-th strip (where $k=1,2, \cdots, 500$) surrounding a vertex, there are $S_{k}=6 k-3$ cells. Since no two blackened cells are adjacent, the maximum number of black cells in this strip is
$$
\left[\frac{S_{k}}{2}\right]=3 k-2=\frac{S_{k}-1}{2} \text { (cells). }
$$

Summing over all 4000 strips, considering that they contain a total of $6 \times 1000^{2}$ cells, the number of black cells does not exceed
$$
\begin{array}{l}
\frac{6 \times 1000^{2}-4000}{2}=3 \times 1000^{2}-2000 \\
=2998000 .
\end{array}
$$

Furthermore, an example is provided to show that there exists a coloring method that meets the requirements and allows for the maximum number of blackened cells.
The two opposite faces of the cube are referred to as the
"top face" and "bottom face," while the other four faces are called
"side faces." In each side face, the cells can be alternately colored black and white in a checkerboard pattern, resulting in half of the cells being black. In

the top face and bottom face, the cells are basically colored in a checkerboard pattern, but the two edge rows are entirely colored white (in Figure 3, the two edge rows of the top face are shown as white).

It is not difficult to see that, with this coloring method, the number of black cells in each strip reaches its maximum possible number (the number of black cells can also be verified by dividing each face into $1 \times 1000$ strips, with four strips being entirely white and the rest having an equal number of black and white cells).