Mrs.ward has a bag of candies for her class. If she gives each student 8 candies ,she will have 4 candies left. If she only gives 5 candies to each student ,she will have 40 candies left . How many students are there in the class?