Exact multiplicity of solutions for some semilinear Dirichlet problems