3.44 Let $p$ be a prime, and $J$ be a $2 \times 2$ matrix $\left(\begin{array}{ll}a & b \\ c & d\end{array}\right)$, whose elements belong to the set $\{0, 1, 2, \cdots, p-1\}$, and satisfy the following two congruences:
$$
\begin{array}{ll}
a+d \equiv 1 & (\bmod p), \\
a d-b c \equiv 0 & (\bmod p) .
\end{array}
$$

Determine the number of matrices $J$.
(29th Putnam Mathematical Competition, 1968)
[Solution] From congruence (1), if $a=0$, then $d=1$; if $a=1$, then $d=0$. In both cases, we have $bc=0$, i.e.,
$$
b=0 \quad \text{or} \quad c=0.
$$

When $b=0$, $c=0,1,2, \cdots, p-1$,
When $c=0$, $b=1,2, \cdots, p-1$.
In this case, the number of solutions for $J$ is $2(p+p-1)=4p-2$.
If $a \neq 0$ or 1, i.e., if
$$
a=2,3,4, \cdots, p-2, p-1,
$$

then the corresponding $d$ is (from (1))
$$
d=p-1, \quad p-2, \quad p-3, \cdots, 3,2.
$$

At this time,
$$
ad \neq 0 \quad(\bmod p).
$$

To make (2) hold, i.e.,
$$
bc \equiv ad \quad(\bmod p),
$$

we can take $b=1,2, \cdots, p-1$.
(Note that $bc \neq 0(\bmod p)$), and the value of $c$ can be uniquely determined. Since there are $p-2$ ways to choose $a$ and $p-1$ ways to choose $b$, in this case, the number of solutions for $J$ is $(p-2)(p-1)$.
Thus, the total number of solutions for $J$ is
$$
4p-2+(p-2)(p-1)=p^2+p.
$$