Gilbert is making trail mix out of 40 bags of nuts and 32 bags of dried fruit. He wants each new portion of trail mix to be identical, containing the same combination of bags of nuts and bags of dried fruit, with no bags left over. What is the greatest number of portions of trail mix Gilbert canmake?