let's say there were "x" pieces total, so then "x" is the 100%, and we know that 3 is 25% of that, so
[tex]\bf \begin{array}{ccll} amount&\%\\ \cline{1-2} x&100\\ 3&25 \end{array}\implies \cfrac{x}{3}=\cfrac{100}{25}\implies \cfrac{x}{3}=4\implies x=12[/tex]