Let $p$ be an odd prime number and $T_p$ is the following set of $2 \times 2$ matrices: $$ T_p = \left\{ A = \begin{bmatrix} a & b \\ c & a \end{bmatrix}\ \Biggm|a,b,c \in \{0,1,2,...(p-1)\} \right\}$$
then how to prove that the number $k$ of $A$ in $T_p$ such that the trace of A is not divisible by $p$ but the $det(A)$ is divisible by $p$, is $k=(p-1)^2$ ?