  We give a sharp bound on the number of triangles in a graph with fixed number
of edges. We also characterize graphs that achieve the maximum number of
triangles. Using the upper bound on number of triangles, we prove that if $G$
is a special $p$-group of rank $2 \leq k \leq \binom{d}{2}$, then
$|\mathcal{M}(G)| \leq p^{\frac{d(d+2k-1)}{2} - k- \binom{d}{3}+ \binom{r}{3} +
\mybinom[.55]{ \binom{d}{2} - k - \binom{r}{2} }{2} }$, where $r$ is such that
$\binom{r}{2} \leq \binom{d}{2} -k < \binom{r+1}{2} $. We also prove that, if
$G$ is a $p$-group $(p \neq 2,3)$ of class $c \geq 3$, then $|\mathcal{M}(G)|
\leq p^{\frac{d(m-e)}{2}+(\delta-1)(n-m)-\max(0,\delta-2)-\max(1,\delta-3)}$
and if $G$ is of coclass $r$ with class $c \geq 3$, then $|\mathcal{M}(G)| \leq
p^{\frac{r^2-r}{2}+kr}$
