Find the number of solutions to a system of equations