Counting students in various combinations of subjects