A group of students decided to buy speakers for a party worth Rs. 600. But at the last moment, five students backed out, so each of the remaining had to pay Rs. x more than what they had planned. If ten students had backed out, each of the remaining would have had to pay Rs. 10 more than what they had planned. Find the value of x and total number of students.