Number of solutions to a system of equations