The sixth grade class has 18 boys and 24 girls. The teacher wants to divide them into groups that have the same number of boys and the same number of girls. What is the greatest possible number of the groups the teacher can make