In a classroom, the teacher has 48 candies and wants to distribute them equally among a certain number of students such that each student receives a whole number of candies. If the number of students is a factor of 48 and is also a multiple of 3, how many ways can the teacher distribute the candies? Let's think step by step and output the final answer within \boxed{}.
user