Owen has 24 pens and 18 notebooks. He wants to divide the pens and notebooks into equal groups. What is the greatest number of groups he can make using all the pens and notebooks?