3. Let $p$ be a prime number. Then the number of integer pairs $(a, b)$ that satisfy
$$
|a+b|+(a-b)^{2}=p
$$

is ( ) pairs.
(A) 3
(B) 4
(C) 5
(D) 6
3. D.

Since $a+b$ and $a-b$ have the same parity, we have
$$
p=2 \text {. }
$$

Thus, the integer pairs $(a, b)$ are
$$
\begin{array}{l}
(1,1),(-1,-1),(0,1), \\
(1,0),(-1,0),(0,-1) .
\end{array}
$$

There are 6 pairs in total.