Number of solutions of quadratic equations