Let the number of instructions be 'n'.
Speedup = $\frac{Time_{non-pipeline}}{Time_{pipeline}}$
Timenon-pipeline = 5 * n * Tclk
Now, let 'x' instructions incur 0 stall cycles, so CPI of these 'x' instrutions =1
Then, 'n-x' instructions incur 3 stall cycles, so CPI of these 'n-x' instructions = 4
Timepipeline = [(x * 1) + [(n-x) * 4]] * Tclk = (4n - 3x) * Tclk
Speedup = $\frac{5n *T_{clk}}{(4n - 3x) * T_{clk}}$ = 3.
$\therefore$ x = $\frac{7n}{9}$
So, number of instructions which incurred 3 stall cycles = n - $\frac{7n}{9}$ = $\frac{2n}{9}$
Percentage = $\frac{\frac{2n}{9}}{n}$ * 100 = 22.2%