A teacher noticed a strange distribution of marks in the exam. There were only three distinct scores 6, 8, and 20. The sum of scores of all the students was 504. The number of students in the most populated category was equal to the sum of the number of students with students who took the exam is: