Exercise 7. Let $p \geqslant 3$ be a prime number. For $k \in \mathbb{N}$ satisfying $1 \leqslant k \leqslant p-1$, the number of divisors of $\mathrm{kp}+1$ that are strictly between $k$ and $p$ is denoted by $a_{k}$.

What is the value of $a_{1}+a_{2}+\ldots+a_{p-1}$?