"After that, another student decided to join the 'herb' classes..."
It doesn`t say another student from the 'mineral' group decided to join the'herb' classes,
So we will have to consider it as a new student, which wasn`t part of either 'mineral' classes or 'herb' classes.
x = nr. of students in 'herb' group
y = nr. of students in 'mineral' group
x-1 = y+1
x+1 = 2*y
x = 5 students, y = 3 students, there is a total of 3 + 5 = 8 students