So I have a group of order $p^2$ (where $p$ is a prime number) and I'm wondering how many subgroups it can have. By Lagrange's theorem I know that if a subgroup exists its order has to divide the order of the group i.e. $p^2$ in other words it has to be of order $1$, $p$ or $p^2$. Of order $1$ we have only the trivial group and of order $p^2$ the group itself while the existence of subgroups of order $p$ is enstablished by Cauchy's theorem but how many of them are there?
I tried to reduce the problem to a combinatorial one however I'm not too familiar with this branch. I reasoned as it follows:
i) I have to choose $p$ element from a set which has $p^2$
ii) the unit must be in the subgroup so we have only to choose $p-1$ elements from a set which has $p^2-1$
iii) for every element the inverse must be in the subgroup so we have only to choose $\frac {p-1}2$ elements (if $p\neq 2$) from a set which has $p^2-1$
iv) for every two elements their composition must be in the subgroup however I don't know how to use this fact and so I don't know how to end the problem. Maybe using the criterion for subgroups can shorten the computation but I'm not sure how to use it.
Tell me if my reasoning is correct and how I should end this exercise